Skip to content

Conversation

@skvale
Copy link
Contributor

@skvale skvale commented May 3, 2019

This prevents cloneElement throwing an error when a child is null, such as with

{condition && <TreeView.Col ...}

Description

  • FormRadioGroup was safe because it had React.isValidElement checks, but I changed it to be consistent.
  • Similar for SideNav
  • TreeView had issues with the introduced test, which now passes

fixes #523

@netlify
Copy link

netlify bot commented May 3, 2019

Deploy preview for fundamental-react ready!

Built with commit ad1b676

https://deploy-preview-535--fundamental-react.netlify.com

Copy link
Contributor

@greg-a-smith greg-a-smith left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. 🚢

@greg-a-smith greg-a-smith changed the title feat(Forms;SideNav;TreeView): Make React.Children null safe fix(Forms;SideNav;TreeView): Make React.Children null safe May 6, 2019
@hertweckhr1
Copy link
Contributor

@skvale can you update this PR? We split our tests up so there are some conflicts, but changes should be pretty simple. Thank you!

@hertweckhr1 hertweckhr1 self-requested a review May 8, 2019 18:11
@skvale
Copy link
Contributor Author

skvale commented May 8, 2019

@hertweckhr1 I just rebased onto master 👍

@jbadan jbadan merged commit 76c13e1 into SAP:master May 9, 2019
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.

Make React.Children maps null-safe

4 participants