reason-react
reason-react copied to clipboard
ppx: support "custom children" in uppercase components without having to wrap in array literal
Fixes #822.
The breaking change is for uppercase components that were introspecting with React.Children. After the change, these components would need to run children through React.array.
It allows to write:
<Test> {Test.name: "foo"} {name: "bar"} </Test>
besides the already possible:
<Test> [|{Test.name: "foo"}, {name: "bar"}|] </Test>
@davesnx what are your thoughts on this?
I wonder if we should mention this difference between uppercase / lowercase components in our documentation.
@anmonteiro We do mention something already:
- https://reasonml.github.io/docs/en/jsx#capitalized-tag
- https://reasonml.github.io/docs/en/jsx#uncapitalized-tag
Do you mean to expand on that?
@anmonteiro We do mention something already:
- https://reasonml.github.io/docs/en/jsx#capitalized-tag
- https://reasonml.github.io/docs/en/jsx#uncapitalized-tag
Do you mean to expand on that?
Right, I wonder if we should mention that these are no longer wrapped in array, or if it's OK just to document it in the changelog.
I wonder if you can add the test case for a fragment (which is a list on the parsetree) which avoids the wrapping.
<Test> <div>{React.string("HI")}<div/> <div>{React.string("HI")}<div/> </Test>