1、错误描述

TypeError: react__WEBPACK_IMPORTED_MODULE_0___default.a.createClass is not a function_错误提示

2、错误原因

import React, {Component} from 'react';
import {render} from 'react-dom';
import Button from 'react-bootstrap/Button';

var TickTock = React.createClass({
mixins: [SetIntervalMixin],
getInitialState: function() {
return {seconds: 0};
},
componentDidMount: function() {
this.setInterval(this.tick, 2000);
},
tick: function() {
this.setState({seconds: this.state.seconds + 1});
},
render: function() {
return (
<label>
{this.state.seconds} seconds.
</label>
);
}
});


     由错误提示可知,是React.createClass不是一个函数(方法)

3、解决办法