0

i am newbie to react.js and i was going through a tutorial to start with.

I tried both the jsx format and non jsx format code. however i am not getting the output displayed. I checked the console and no errors reported in chrome.

what am i missing here?

My code:

<!DOCTYPE html>
<head>
<meta charset = "UTF-8">
<title> React.js <title>

<script type="text/javascript" src = "http://fb.me/react-0.12.2.js"></script>
<script type="text/javascript" src = "http://fb.me/JSXTransformer-0.12.2.js"></script>
</head>

<body>

<script type="text/jsx">

/*var App = React.createClass(
{
   render:function()
   {
        return <h1> Hello there </h1>
   }

});

React.render(<App />, document.body);*/


</script>

<script>

    var App = React.createClass(
        {
            render: function()
            {
                return React.DOM.h1(null,"Hi  there")
            }
        });

    React.render(App(), document.body);


</script>




</body>

</html>
2
  • You have forgotten to close your title tag Commented May 27, 2015 at 8:09
  • oh! my bad. thx dart programmer! Commented May 27, 2015 at 8:11

1 Answer 1

1

You're not closing the title tag. This: <title> React.js <title> should be this: <title> React.js </title>. If you change that, the heading renders like it should.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.