I used webpack to set react envirement, and run the code using this line:
webpack -d && webpack-dev-server --content-base src/ --inline --hot --port 1234
The cmd runs some builds, and than shows the line:
webpack: Compiled successfully.
instead of :
webpack: bundle is now VALID
like I saw in the example.
and than it says on the browser console:
Uncaught TypeError: React.createClass is not a function
What could it be?
my dependencies:
"dependencies": {
"react": "^16.0.0",
"react-dom": "^16.0.0"
},
"devDependencies": {
"babel-core": "^6.26.0",
"babel-loader": "^7.1.2",
"babel-preset-es2015": "^6.24.1",
"babel-preset-react": "^6.24.1",
"webpack": "^3.8.1",
"webpack-dev-server": "^2.9.4"
}
my code:
var React = require('react');
var ReactDOM = require('react-dom');
// Create component
var TodoComponent = React.createClass({
render: function () {
return(
<h1>Hello!!</h1>
);
}
});
// put component into html page
ReactDOM.render(<TodoComponent />, document.getElementById('todo-container'));
By the way, this is my first question here, so please forgive me for starters mistakes.. ;)