score:1

Accepted answer

You need to use the render function correctly:

render(
  <div>
    Hello react!
  </div>,
  document.getElementById('root')
);

(Instead of render { ... })

score:0

I think you're missing the Babel configuration, either in webpack (in the loaders section) or the .babelrc file itself. You need to tell Babel to process your code and apply the react preset.

If you post your webpack.config.js and .babelrc we'll be able to point the specific missing part.

Otherwise you may want to take a look into the create-react-app package which is a great and official way to kickstart a React app.

https://github.com/facebookincubator/create-react-app


Related Query

More Query from same tag