simon360 / react-from-markup

Declare your React components with static HTML
MIT License
18 stars 4 forks source link

Solve for React.Fragment being returned from rehydrateChildren #8

Closed simon360 closed 6 years ago

simon360 commented 6 years ago

rehydrateChildren will return one of two results:

  1. a single node, if an element only contains a single child
  2. a React.Fragment, if an element contains > 1 child

Wrapping children in a React.Fragment can interfere with React.Children.forEach (and the other React.children functions).

The previous behaviour in wel-ui was to return an array. Perhaps it's worth reverting to that, and always returning an array?

simon360 commented 6 years ago

Current thinking: