0

I get the below error message when I open my html file.

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

This is my Html code

</head>
<body>
    <div id="content"></div>
    <script src="js/bundle.js"></script>
</body>
</html>

This is my app.js file import firstComponent from './firstComponent'

This is my first component.js file

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')
  );

Please Help me with this

Aarthi Ananth
  • 460
  • 1
  • 4
  • 16

1 Answers1

1

The name of the component has to started with a capital letter and you have to use use the same name when you use the component.

The component is

<CommentBox/>

not

<commentBox/>

dinidu
  • 230
  • 2
  • 7