A top-level App
component returns <Button />
from its render()
method.
-
What is the relationship between
<Button />
andthis
in thatButton
’srender()
? -
Does rendering
<Button><Icon /></Button>
guarantee that anIcon
mounts? -
Can the
App
change anything in theButton
output? What and how?
<Button />
is aReact.Element
- a description of what is to be rendered. Most importantly it says that aButton
instance is needed for the render and whichprops
should be passed to it.this
refers to thatButton
instance.<Icon />
to theButton
asprops.children
. What mounts inside theButton
depends solely on theButton
(namely itsrender
andshouldComponentUpdate
).Button
output" you mean theReact.Element
description returned by itsrender()
, then no. It controls what's passed toButton
inprops
and it can later act on theButton
instance, but it has no way to access theReact.Element
returned fromButton
'srender()
.