Reactjs running in apache

Asked

Viewed 358 times

1

I have the following structure to display the famous Hello World with reactjs:

<!DOCTYPE html>
<html>
   <head>
      <meta charset="UTF-8">
      <title></title>
      <script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.3.2/react.min.js"></script>
      <script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.3.2/react-dom.min.js"></script>
      <script src="https://cdnjs.cloudflare.com/ajax/libs/babel-core/6.1.19/browser.min.js"></script>          
  </head>
  <body>                   

     <div id="root"></div>  

     <script type="text/babel">
         ReactDOM.render(
                <h1>Hello World</h1>,
                document.getElementById('root')
         );
     </script>   
  </body>
</html>

I am using the latest version of xampp and using netbeans as IDE with php plugin.
When I run the project the blank page appears in the browser. There would be some error in the code?

This error appeared on the console (now that I saw):

inserir a descrição da imagem aqui

  • has some error in browser console?

  • Comment on Babel import and see if it works

1 answer

1

The code did not run because of the Babel core version. Versions 6.1 to the latest feature the posted image error; from versions 6.0.0 to 6.0.20, content is not displayed; from versions earlier than 6.0.0, content is fully displayed.

inserir a descrição da imagem aqui

I thank those who helped; for as far as this problem has been solved!

Browser other questions tagged

You are not signed in. Login or sign up in order to post.