3 ms·
React components access the children value through the children property of the props object, so it's not just an implementation detail. It's part of the compon
by AgentME 6y ago
React components access the children value through the children property of the props object, so it's not just an implementation detail. It's part of the component API.
I think the similarity between the children value and other props is useful, to emphasize how any prop can contain child JSX elements. There's nothing special to the children value besides some syntax sugar. You can pass JSX elements to any other prop too.
- lucideer 6y agoYou're right it's part of the React component API but JSX is a spec. independent of React. The React component API is not part of JSX (and has little bearing on it).