score:29

Accepted answer

reactdom available since version 0.14.0, so you need to use react.render (because you have a react version 0.13.3) instead,

setinterval(function() {
  react.render(
    <helloworld date={new date()} />,
    document.getelementbyid('example')
  );
}, 500);

or upgrade your react version and include reactdom

changes in react 0.14

score:0

to make it work properly, you have to do 3 things.

  1. import the cdns, necessary for the developement(say react and react-dom for web development)
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
  1. install babel-cli . it is needed for the compilation of jsx into vanila js

  2. change the typo in your code,

it is reactdom , not raactdom

score:2

make sure it's reactdom (case sensitive)
          class app extends react.component {
            render() {
                return (
                    <div>
                        <div classname="commentbox">hello react ! </div>
                    </div>
                );
            }
        }
        reactdom.render(<app />, document.getelementbyid('root'));

score:8

make sure that you've included react-dom.js. you can add it from cdn or use js toolchain of your choice.

installing react - using a cdn

<script src="https://unpkg.com/react@15/dist/react.js"></script>
<script src="https://unpkg.com/react-dom@15/dist/react-dom.js"></script>

score:16

you have to import it

import reactdom from 'react-dom';

score:81

it may be the spelling issue - it is reactdom, not reactdom.

this has changed over time with the new release of react


Related Query

More Query from same tag