I did a html page like this
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>React project</title>
<script crossorigin src="https://unpkg.com/react@16/umd/react.production.min.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script>
<script src="https://unpkg.com/babel-core@5.8.38/browser.min.js"></script>
</head>
<body>
<div id="root"></div>
<script src="react.js" type="text/babel"></script>
</body>
</html>
And the file react.js like this
var Comp1 = React.createClass({
render: function() {
return(
<h1> Comp1 </h1>
);
}
});
ReactDOM.render(
<div>
<Comp1/>
</div>,
document.getElementById("root")
);
But, I got "Uncaught TypeError: React.createClass is not a function" exception, why?