You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Suggestion]: Documentation does not make mention of the difference between props.children and directly rendering children as it relates to rendering behaviour. #8007
However, there is an important different in how these components behave as far as rendering behaviour goes.
In the first style, every render of ChildrenStyleOne (eg. say because state is changing), will also cause a render of SomeThing.
In the second style, additional renders of ChildrenStyleTwowill not cause renders of the {props.children}.
This is a useful distinction to be aware of - using the props.children/slots approach is a simple mechanism to avoid full branch renders.
I've observed people commonly believing that 'every time a context provider's state changes, everything below it will render' - and I believe this misconception arrises from not being aware of this difference in rendering behaviour.
We can see that FancyText here is a directly rendered child, while Copyright is a props.children child.
The render tree described in the docs makes no distinction between the two.
I imagine this is likely a deliberate decision on the the part of the React maintainers - simplifying the conceptual model. If that's the case, is there a blog post or something that talks about what the strategy is?
The docs perhaps could do with a deep dive note that makes mention of this distinction or links to a more comprehensive optimisation section elsewhere.
I'll first verify the rendering behavior described here and review the relevant React documentation and concepts. Based on that, I'll propose a focused documentation improvement that explains the distinction between directly rendered children and children passed through props.children.
Activity
TrapSack commentedon Oct 6, 2025
Hey! Actually, I think that the closest definition and mention of that lays in Context Section (eg
https://react.dev/learn/passing-data-deeply-with-context#context-passes-through-intermediate-components
)
Also, would be nice to have the mention for a page you described
Siddharth22GIT commentedon Oct 4, 2026
Hi! I'd like to work on this issue.
I'll first verify the rendering behavior described here and review the relevant React documentation and concepts. Based on that, I'll propose a focused documentation improvement that explains the distinction between directly rendered children and children passed through props.children.
Thanks!