A top-level App component returns <Button /> from its render() method.
-
What is the relationship between
<Button />andthisin thatButton’srender()? -
Does rendering
<Button><Icon /></Button>guarantee that anIconmounts? -
Can the
Appchange anything in theButtonoutput? What and how?
<Button />is aReact.Element- a description of what is to be rendered. Most importantly it says that aButtoninstance is needed for the render and whichpropsshould be passed to it.thisrefers to thatButtoninstance.<Icon />to theButtonasprops.children. What mounts inside theButtondepends solely on theButton(namely itsrenderandshouldComponentUpdate).Buttonoutput" you mean theReact.Elementdescription returned by itsrender(), then no. It controls what's passed toButtoninpropsand it can later act on theButtoninstance, but it has no way to access theReact.Elementreturned fromButton'srender().