Skip to content

Instantly share code, notes, and snippets.

@gaearon
Last active January 11, 2024 16:56
Show Gist options
  • Save gaearon/8fa9fdd2c4197ee0b52894877bf587a4 to your computer and use it in GitHub Desktop.
Save gaearon/8fa9fdd2c4197ee0b52894877bf587a4 to your computer and use it in GitHub Desktop.

A top-level App component returns <Button /> from its render() method.

  1. What is the relationship between <Button /> and this in that Button’s render()?

  2. Does rendering <Button><Icon /></Button> guarantee that an Icon mounts?

  3. Can the App change anything in the Button output? What and how?


Update: answers are here!

@wmira
Copy link

wmira commented Sep 30, 2016

  1. defines the tree..with type as Button. this in Button is the actual instance created based on tree.
  2. No. the in the is just a description of the tree of elements. It is still possible for the Button instance to ignore it.
  3. via props if permitted by Button

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment