Open cknitt opened 1 week ago
What should it say? "Children should be passed as JSX, not a prop"?
let _ = <A children={React.string("test")} />
I not certainly sure, is it allowed in the React usage? As far as I know it is not allowed.
I not certainly sure, is it allowed in the React usage? As far as I know it is not allowed.
It seems to work in babel.
I am not saying that we should allow it in ReScript, just that the error message is confusing in this case.
What should it say? "Children should be passed as JSX, not a prop"?
"Children must be passed as JSX content, not as a prop. Ensure that child elements are placed between the opening and closing tags of the component."
When one has a React component accepting children, e.g.
and, instead of passing the children like this:
one accidentally passes them as a prop:
then one gets the error message
which feels weird as children were actually passed only once.