reactjs Cannot read property 'keys' of undefined

前端 未结 5 1209
星月不相逢
星月不相逢 2020-12-15 03:19

I am learning reactjs through a tutorial and ran into this error. That says \"Cannot read property \'keys\' of undefined\" My code is very minimal so I assume that it has to

5条回答
  •  情书的邮戳
    2020-12-15 03:59

    I haven't worked with React before, but there are a few things that I see that may be causing your issues. First, React.createClass instead of ReactDOM.createClass. Second, you need to wrap your html in parentheses:

    var HelloWorld = React.createClass({
      render: function() {
        return (
          

    Hello World

    This is some text>

    ); } });

    This should get it working

提交回复
热议问题