test.html 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="UTF-8" />
  5. <title>Hello World</title>
  6. <script src="https://unpkg.com/react@18/umd/react.development.js"></script>
  7. <script src="https://unpkg.com/react-dom@18/umd/react-dom.development.js"></script>
  8. <!-- Don't use this in production: -->
  9. <script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
  10. </head>
  11. <body>
  12. <div id="root"></div>
  13. <script type="text/babel">
  14. function MyApp() {
  15. return
  16. <h1>Hello, world!</h1>;
  17. }
  18. const container = document.getElementById('root');
  19. const root = ReactDOM.createRoot(container);
  20. root.render(
  21. <myapp />);
  22. </script>
  23. <!--
  24. Note: this page is a great way to try React but it's not suitable for production.
  25. It slowly compiles JSX with Babel in the browser and uses a large development build of React.
  26. Read this page for starting a new React project with JSX:
  27. https://react.dev/learn/start-a-new-react-project
  28. Read this page for adding React with JSX to an existing project:
  29. https://react.dev/learn/add-react-to-an-existing-project
  30. -->
  31. </body>
  32. </html>