Here is a page created purely for experiments:

<html> <head> <title>Hello World!</title> </head> <body> <div id="root">New window</div> <script type="text/jsx" src="index.jsx"/> </body> </html> 

And the code index.jsx :

 import React from 'react' import ReactDOM from 'react-dom' ReactDOM.render( <h1>Hello, world!</h1>, document.getElementById('root') ); 

And now, when you start the application, the page loads normally, but the value stored in root does not change. What's wrong?

Thanks in advance.

  • What makes your jsx javascript normal? - Duck Learns to Take Cover
  • one
    need to watch what he writes in the console - Alex Slobodyansky
  • one
    before creating .babelrc, I would just connect react, react-dom, babel through cdn. js file type text / babel - Alex Slobodyansky
  • one
    Yes, so is the reactor in the same way - Alex Slobodyansky
  • one
    Remark: for the test case, connect the Babel React and all-all-through cdn norms, and for an already combat project it is better to do Feng Shui, via npm and webpack - Duck Learns to Cover

0