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

Don't break when a child is null #283

Merged
merged 5 commits into from
Jul 27, 2018
Merged

Don't break when a child is null #283

merged 5 commits into from
Jul 27, 2018

Conversation

davvidbaker
Copy link
Contributor

It's a pretty common pattern that to do something like

<Wrapper>
  {this.state.isVisible && <Child />}
  <OtherElement />
</Wrapper>

This PR makes that possible within the <SplitPane /> component. It does this by filtering out all falsy children elements before mapping or reducing over them.

Let me know what you think, and thanks for all your hard work!

Copy link
Collaborator

@wuweiweiwu wuweiweiwu left a comment

Choose a reason for hiding this comment

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

Hi Thanks again for contributing!

Do you mind removing the storybook? I don't believe we currently have a storybook in place

@davvidbaker
Copy link
Contributor Author

Do you mind removing the storybook?

For sure. Sorry for the extra commits. Stupid line at end of file kept not deleting.

@coveralls
Copy link

Coverage Status

Coverage increased (+0.08%) to 93.548% when pulling 93d07cd on davvidbaker:v2 into 22e649c on tomkp:v2.

@wuweiweiwu
Copy link
Collaborator

wuweiweiwu commented Jul 26, 2018

@davvidbaker should this be based off of master instead?

Can you also do the same PR for master? :)

@davvidbaker
Copy link
Contributor Author

Can you also do the same PR for master? :)

#307 👍

@wuweiweiwu wuweiweiwu merged commit 9c49aad into tomkp:v2 Jul 27, 2018
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.

3 participants