piffy

Hello, react

Aug 9th, 2021 (edited)
284
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2. <html lang="it">
  3. <head>
  4.     <meta charset="UTF-8">
  5.     <title>Primo esempio di pagina che usa React</title>
  6. </head>
  7. <body>
  8.  
  9. <div id="radice"></div>
  10.  
  11. <!-- Inclusione di React e React-dom -->
  12. <script src="https://unpkg.com/react@16.7.0/umd/react.production.min.js"></script>
  13. <script src="https://unpkg.com/react-dom@16.7.0/umd/react-dom.production.min.js"></script>
  14.  
  15. <!-- Inclusione del transpiler Babel -->
  16. <script src="https://unpkg.com/babel-standalone@6/babel.min.js"></script>
  17.  
  18. <script type="text/babel">
  19.     const elementoReact = <h1>Hello, React!</h1>;
  20.     const radice = document.querySelector('#radice');
  21.     ReactDOM.render(elementoReact, radice);
  22.     console.log(elementoReact);
  23. </script>
  24. </body>
  25. </html>
RAW Paste Data