From 6a406ae2b634e487e1bed73d337d3364c4153aac Mon Sep 17 00:00:00 2001 From: jljsj Date: Mon, 30 Nov 2015 15:55:19 +0800 Subject: [PATCH] is null or no key, direct return --- src/Animate.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Animate.js b/src/Animate.js index 9ae8a3a..34843b5 100644 --- a/src/Animate.js +++ b/src/Animate.js @@ -5,7 +5,7 @@ import { findShownChildInChildrenByKey, findChildInChildrenByKey, isSameChildren, -} from './ChildrenUtils'; + } from './ChildrenUtils'; import AnimateChild from './AnimateChild'; const defaultKey = 'rc_animate_' + Date.now(); import animUtil from './util'; @@ -271,8 +271,8 @@ const Animate = React.createClass({ let children = null; if (stateChildren) { children = stateChildren.map((child) => { - if (!child.key) { - throw new Error('must set key for children'); + if (!child || !child.key) { + return child; } return (