How to get started with ReactJS Hello World example?

Kim Stacks

I am using MacBook Pro.

I prefer to use ubuntu in a VM for web development.

I created a index.html inside my Macbook and then simply open it with Chrome.

The html was created following this video

and this is my code

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <meta name=description content="">
    <meta name=viewport content="width=device-width, initial-scale=1">
    <title>First Component</title>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.13.0-beta.1/react.min.js"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/react/0.13.0-beta.1/JSXTransformer.js"></script>
</head>
<body>
    <script type="text/jsx">
    /** @jsx React.DOM */
    var APP = React.createClass({
        render: function() {
            return (
                <h1>Hello World</h1>
            );
        }
    });

    React.renderComponent(<APP />, document.body);
    </script>
</body>
</html>

I got the following error:

enter image description here

When I expand on the error:

enter image description here

Please advise.

Dhiraj

Update:

In the newer versions it is (documentation)

ReactDOM.render(reactElement, domContainerNode)

It is should be React.render and not React.renderComponent as per documentation

The video you mentioned uses 0.8 and you are using 0.13.

From 0.12 renderComponent has been replaced with render

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How to get started with ReactJS Hello World example?

From Dev

How to write a hello world example in AWS Lambda using Python 2.7?

From Dev

How to run Apple's OpenCL "Hello World" example in XCode

From Dev

Graphics driver "hello world" example?

From Dev

Spring hello world example error

From Dev

Hello world minitest cli example

From Dev

How to get PhoneGap 3.5 Android Hello World to work in Eclipse?

From Dev

How to get the Hello "Newline" and World in powershell using regex?

From Java

MEDIAPIPE failed run hello world from example

From Dev

mithril hello world MVC example not working

From Dev

JointJS: Hello World example doesn't work

From Dev

Node.js Error for Hello World example

From Dev

Simple TCPClient/Listener ("hello world") example

From Dev

"Hello World" in Openvms/Itanium assembly example?

From Dev

"Hello World" example for Slick 2.0 with MySQL

From Dev

CMake - Code::Blocks - hello world - basic example

From Dev

ServiceStack hello world example not generating soap proxies

From Dev

MVC using Spring hello world example

From Dev

Calling Methods In Java - Hello World Example

From Dev

AngularJS, $routeProvider and resolve: Hello World example not working

From Java

How does this print "hello world"?

From Dev

How "Hello World" works in C

From Dev

how to show hello world in react?

From Dev

How can I convert the string "Hello this is world" to "world is this Hello" in CSS?

From Dev

Cannot GET / error running hello world in webpack

From Dev

Can't get hello world in django

From Dev

why does this "hello world" golang http example slow down on osx

From Dev

Function arguments in node.js' Hello World example

From Dev

Why is the first "hello world" example in the django book not working?

Related Related

  1. 1

    How to get started with ReactJS Hello World example?

  2. 2

    How to write a hello world example in AWS Lambda using Python 2.7?

  3. 3

    How to run Apple's OpenCL "Hello World" example in XCode

  4. 4

    Graphics driver "hello world" example?

  5. 5

    Spring hello world example error

  6. 6

    Hello world minitest cli example

  7. 7

    How to get PhoneGap 3.5 Android Hello World to work in Eclipse?

  8. 8

    How to get the Hello "Newline" and World in powershell using regex?

  9. 9

    MEDIAPIPE failed run hello world from example

  10. 10

    mithril hello world MVC example not working

  11. 11

    JointJS: Hello World example doesn't work

  12. 12

    Node.js Error for Hello World example

  13. 13

    Simple TCPClient/Listener ("hello world") example

  14. 14

    "Hello World" in Openvms/Itanium assembly example?

  15. 15

    "Hello World" example for Slick 2.0 with MySQL

  16. 16

    CMake - Code::Blocks - hello world - basic example

  17. 17

    ServiceStack hello world example not generating soap proxies

  18. 18

    MVC using Spring hello world example

  19. 19

    Calling Methods In Java - Hello World Example

  20. 20

    AngularJS, $routeProvider and resolve: Hello World example not working

  21. 21

    How does this print "hello world"?

  22. 22

    How "Hello World" works in C

  23. 23

    how to show hello world in react?

  24. 24

    How can I convert the string "Hello this is world" to "world is this Hello" in CSS?

  25. 25

    Cannot GET / error running hello world in webpack

  26. 26

    Can't get hello world in django

  27. 27

    why does this "hello world" golang http example slow down on osx

  28. 28

    Function arguments in node.js' Hello World example

  29. 29

    Why is the first "hello world" example in the django book not working?

HotTag

Archive