Skip to content
This repository has been archived by the owner on Nov 3, 2021. It is now read-only.

Commit

Permalink
Merge pull request #241 from google-fabric/falsey-children
Browse files Browse the repository at this point in the history
Adds guard against falsey children
  • Loading branch information
fionawhim authored Apr 17, 2018
2 parents 760d1c5 + dab1b1e commit b65e87f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
### v1.4.1 (2018-04-17):

Fixes false children bug #240. (Thanks for the report, @tiffanytangt!)

### v1.4.0 (2018-04-12):

Dependency upgrades! No new features.
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ details about why and how we built this.

See the [live demo](http://google-fabric.github.io/velocity-react/).

**Latest version:** v1.4.0 Removes some React 16.3 deprecations and warnings
**Latest version:** v1.4.1 Fixes a `null` child regression in v1.4.0

*Note: v1.1.0 and later require React 0.14.x*
*Note: v1.3.0 and later require React 15.3.x and should work with React 16*
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "velocity-react",
"version": "1.4.0",
"version": "1.4.1",
"description": "React components to wrap Velocity animations",
"main": "index.js",
"scripts": {
Expand Down
6 changes: 6 additions & 0 deletions src/velocity-transition-group.js
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,12 @@ class VelocityTransitionGroup extends React.Component {
}

_wrapChild(child) {
// Need to guard against falsey children, which React will sometimes pass
// in.
if (!child) {
return null;
}

return React.createElement(
VelocityTransitionGroupChild,
{
Expand Down

0 comments on commit b65e87f

Please sign in to comment.