2015-07-03 39 views
3

我在调用React的CSS转换组属性。CSSTransition Group Not Working(undefined)React.js

在我的js文件:

var ReactCSSTransitionGroup = React.addons.CSSTransitionGroup; 

我得到这个确切的错误:

Uncaught TypeError: Cannot read property 'CSSTransitionGroup' of undefined 

任何想法?

+0

你使用阵营'反应与 - addons.js'? – octref

回答

1

确保您使用的是带有附加组件

<script src="https://fb.me/react-with-addons-0.13.3.min.js"></script>

http://facebook.github.io/react/downloads.html

+0

如何在npm中使用这个插件库? –

+3

@MandeepPasbola你可以单独通过npm使用每个反应插件。 读 https://facebook.github.io/react/docs/addons.html 所以对于CssTransitionGroup 你 安装'NPM安装-S -E反应 - 插件 - CSS-过渡group' 然后可以要求这样 '变种ReactCSStransitionGroup =要求( '反应-插件-CSS-过渡组');' https://facebook.github.io/react/docs/animation.html – andykenward

+0

由于对安迪肯沃德的帮助。 –