0
htmlファイルを開くと、以下のエラーメッセージが表示されます。React JSのキャッチされていないタイプのエラー
TypeError: undefined is not a function (near
'..._react2.default.createClass...')
(anonymous function)bundle.js 966
_webpack_require bundle.js 20
(anonymous function)bundle.js 73
_webpack_require bundle.js 20
(anonymous function)bundle.js 63
_webpack_require bundle.js 64
これは私のHTMLコード
</head>
<body>
<div id="content"></div>
<script src="js/bundle.js"></script>
</body>
</html>
である。これは私のapp.jsが import firstComponent from './firstComponent'
ファイルこれが私の最初のcomponent.jsファイルです
import React from 'react'
import ReactDOM from 'react-dom'
var CommentBox=React.createClass({
render:function(){
return(
<div className="CommentBox">
HelloWorldCommentBox
</div>
);
}
});
ReactDOM.render(
<commentBox/>,
document.getElementById('content')
);
私を助けてくださいこれで
'commentBox'が' CommentBox' – Rajesh
@Rajeshなぜすべきですか?私は、エラーが 'createClass'が16で削除されたという事実によると思われます。 – Li357
@ Li357私はそれについては気づいていません。 – Rajesh