Skip to content

Conversation

@dharFr
Copy link
Contributor

@dharFr dharFr commented Apr 12, 2017

While testing preact@8 within our existing code base, we encountered the following error :
css-transition-group-preact8

As far as I understand, preact@8 components might receive an array containing null values (e.g. [null]) as children property while it never happened in the previous versions.

This PR attempts to fix the compatibility with preact@8:

  • The first commit add a test case that reproduce our use case. The test pass when running npm test or PREACT_VERSION=7.2.0 npm test but fails with PREACT_VERSION=8.1.0 npm test
  • The second commit attempts to fix the issue by filtering out the null entries that might be received in the children prop. Please tell me if it's a good approach or not.
  • EDIT : I also added version 7.2.1 and 8.1.0 to travis.yml in the last commit, so the test is actually ran on the appropriate versions.

dharFr added 2 commits April 12, 2017 11:52
Occurs when `CSSTransitionGroup` is provided with `children` containing `null`
@dharFr dharFr changed the title Preact8 null children Error thrown with Preact8 Apr 12, 2017
@developit
Copy link
Owner

Wow, this is a flawless PR. Thanks dude.

@developit developit merged commit 6ddcc07 into developit:master Apr 12, 2017
@dharFr
Copy link
Contributor Author

dharFr commented Apr 12, 2017

You're welcome!
Thanks for merging it so fast 🤘

@dharFr
Copy link
Contributor Author

dharFr commented Apr 13, 2017

@developit Any chance for the fix to be released on npm?

@developit
Copy link
Owner

Yup!

@developit
Copy link
Owner

Released as 1.2.0 👍
Thanks again for the great PR.

@dharFr dharFr deleted the preact8-null-children branch April 25, 2017 10:03
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.

2 participants