reasonml / reason-react

Reason bindings for ReactJS
https://reasonml.github.io/reason-react/
MIT License
3.25k stars 347 forks source link

Fix multi-child fragment #852

Closed jchavarri closed 3 weeks ago

jchavarri commented 4 weeks ago

Currently, this code <> <div/> <div/> </> will trigger the infamous warning: Each child in a list should have a unique "key" prop.

This PR modifies the expression switch for fragments so that those with 0 or 1 child use jsx and those with 2 or more children use jsxs.

tatchi commented 4 weeks ago

Nice, thanks! 🤗