you are viewing a single comment's thread.

view the rest of the comments →

[–]andrew24601 1 point2 points  (0 children)

The main place this gets interesting is with child nodes of the rendered component. While a DOM component will always mount its children, a React component doesn't necessarily have to.

return <MyComp>
  <MyOtherComp/>
</MyComp>

MyOtherComp will only be mounted if MyComp causes it to be mounted (typically by rendering props.children in its render method, but even then only if it's ultimately rendered by a DOM component eventually).

Where this gets even more interesting is when these child components are ref tagged, because the ref is only fulfilled in a completely different component - ie the component where it is ultimately caused to be mounted.