CSSTransitionGroup __reactAutoBindMap错误

时间:2015-07-26 08:10:06

标签: reactjs

我正在尝试使用React和CSSTransitionGroup。如果我添加<MyTransitionGroup ../>,我会收到警告“Something正在直接调用React组件”,并且出现错误“Uncaught TypeError:无法读取未定义的属性'__reactAutoBindMap'”

如果我删除<MyTransitionGroup ../> - 一切都很好。我查看了已编译的js,并将<MyTransitionGroup ../>编译为React.createElement(MyTransitionGroup... - 所以似乎jsx编译器似乎没有过时..

'use strict';
var React = require('react');
var Addons = require('react-addons');
var MyTransitionGroup = Addons.CSSTransitionGroup;
var style = require('./Screen.scss');

var Screen = React.createClass({
  render: function () {
    var style = {
        backgroundColor: this.props.data.bgcolor
    };
    return (
        <MyTransitionGroup transitionName="example" transitionAppear={true}> **// remove this and it works**
            <div style={style} className="Screen">
                {this.props.data.stitle}
            </div>
        </MyTransitionGroup>
    );
  }
});

module.exports = Screen;

0 个答案:

没有答案