Skip to content
New issue

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

Flatten children with React.Children.toArray upfront #76

Merged
merged 5 commits into from
Sep 23, 2020

Conversation

resolritter
Copy link
Collaborator

@resolritter resolritter commented Sep 5, 2020

https://reactjs.org/docs/react-api.html#reactchildrentoarray

closes #65: in the single child case, where React will turn it into [child]
closes #62: on nested JSX expressions which map over a data structure, React.Children.toArray will flatten everything into a single list of children

@resolritter resolritter force-pushed the fix_single_child branch 2 times, most recently from b6f5c87 to aac75a3 Compare September 5, 2020 01:51
@resolritter resolritter changed the title Wrap a single child into an array for getSteps Flatten children with React.Children.toArray upfront Sep 5, 2020
src/index.js Outdated Show resolved Hide resolved
@resolritter resolritter mentioned this pull request Sep 5, 2020
- useful for the single child case, where React will turn it into [child]
- useful for JSX expressions which map over a data structure, because React.Children.toArray will flatten everything
@resolritter
Copy link
Collaborator Author

@jcmcneal to be clear, do you want me to merge it myself or will you do it?

@jcmcneal jcmcneal merged commit 74267d4 into jcmcneal:master Sep 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Failure if there is only one child of the stepwizard Not loading all the steps
2 participants