javascript - React error "Uncaught TypeError: type.toUpperCase is not a function" on a hello world app -


i have started dabbling reactjs, , on following tutorial , got error on title, on running simple hello world app. below single page code have:

   <!doctype html>     <html lang="en">     <head>       <meta charset="utf-8">       <title>document</title>         <script src="https://fb.me/react-0.13.3.js"></script>         <script src="https://fb.me/jsxtransformer-0.13.3.js"></script>     </head>     <body>       <script type="text/jsx">         // define class         var helloworld = react.createclass({           render: function() {             return <div>               hello world!             </div>           }         });          // create element class         var element = react.createelement({helloworld});          // render class ,  place in body tag         react.render(element, document.body);       </script>     </body>      </html> 

any hints or resolution appreciated.

there mistake in following line:

var element = react.createelement({helloworld}); 

it should be:

var element = react.createelement(helloworld); 

notice lack of curly braces.


Comments

Popular posts from this blog

python - pip install -U PySide error -

arrays - C++ error: a brace-enclosed initializer is not allowed here before ‘{’ token -

cytoscape.js - How to add nodes to Dagre layout with Cytoscape -