Open wozitto opened 6 months ago
The code throws an error.
const SectionTitle = (props) => ( <h2 {...props} /> );
However, this code does not throw an error.
const SectionTitle = (props) => ( <h2 {...props} >{props.children}</h2> );
Both syntaxes produce the same output when rendered, which leads me to believe that the first syntax should not result in an error either.
Version: 6.8.0
This is the natural limits of syntactic analysis - we can’t know if children is included in the props, so we have to require a syntactic children placement.
The code throws an error.
However, this code does not throw an error.
Both syntaxes produce the same output when rendered, which leads me to believe that the first syntax should not result in an error either.
Version: 6.8.0