We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When one has a React component accepting children, e.g.
module A = { @react.component let make = (~children) => <div> {children} </div> }
and, instead of passing the children like this:
let _ = <A> {React.string("test")} </A>
one accidentally passes them as a prop:
let _ = <A children={React.string("test")} />
then one gets the error message
JSX: somehow there's more than one `children` label
which feels weird as children were actually passed only once.
The text was updated successfully, but these errors were encountered:
What should it say? "Children should be passed as JSX, not a prop"?
Sorry, something went wrong.
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.
"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."
mununki
No branches or pull requests
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.
The text was updated successfully, but these errors were encountered: