Browserify

时间:2016-04-02 17:41:39

标签: reactjs browserify

var _carouselListJsx = require('./carouselList.jsx');

var _reactRedux = require('react-redux');

var CarouselOuter = (function(_React$Component) {
_inherits(CarouselOuter, _React$Component);

function CarouselOuter(props) {
    _classCallCheck(this, CarouselOuter);

    _React$Component.call(this, props);
    this.state = this.state || {};
    this.state.jsEnabled = false;
}

CarouselOuter.prototype.componentDidMount = function componentDidMount() {
    this.setState({
        jsEnabled: true
    });
};

CarouselOuter.prototype.render = function render() {
    return _react2['default'].createElement(
        'div',
        null,
        _react2['default'].createElement(
            'ul',
            null,
            this.props.photoData.map(function(data, index) {

                return _react2['default'].createElement(_carouselListJsx.CarouselList, {
                    key: index
                });
            })
        )
    );
};

return CarouselOuter;
})(_react2['default'].Component);

我上面是我的.jsx文件的browerified部分。文件carouselList.jsx很好,因为我可以console.log这很好,但是当CarouselOuter试图通过_carouselListJsx.CarouselList呈现它时,它是未定义的。

我不确定_carouselListJsx.CarouselList引用了什么,但它未定义。下面是CarouselList.jsx文件

import React from 'react';

class CarouselList extends React.Component {

    constructor(props) {

        super(props);
    }

    render() {

        return (
            <div>
          </div>
        );
    }

}

export default CarouselList;

任何想法/帮助表示感谢。

0 个答案:

没有答案