Search
 
SCRIPT & CODE EXAMPLE
 

JAVASCRIPT

getting started with react

<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <title>Hello World</title>
    <script src="https://unpkg.com/react@18/umd/react.development.js"></script>
    <script src="https://unpkg.com/react-dom@18/umd/react-dom.development.js"></script>

    <!-- Don't use this in production: -->
    <script src="https://unpkg.com/@babel/standalone/babel.min.js"></script>
  </head>
  <body>
    <div id="root"></div>
    <script type="text/babel">
    
      function MyApp() {
        return <h1>Hello, world!</h1>;
      }

      const container = document.getElementById('root');
      const root = ReactDOM.createRoot(container);
      root.render(<MyApp />);

    </script>
    <!--
      Note: this page is a great way to try React but it's not suitable for production.
      It slowly compiles JSX with Babel in the browser and uses a large development build of React.

      Read this section for a production-ready setup with JSX:
      https://reactjs.org/docs/add-react-to-a-website.html#add-jsx-to-a-project

      In a larger project, you can use an integrated toolchain that includes JSX instead:
      https://reactjs.org/docs/create-a-new-react-app.html

      You can also use React without JSX, in which case you can remove Babel:
      https://reactjs.org/docs/react-without-jsx.html
    -->
  </body>
</html>
Comment

PREVIOUS NEXT
Code Example
Javascript :: jQuery - Chaining 
Javascript :: change form value dynamically angular 
Javascript :: button click 
Javascript :: .map method 
Javascript :: json object array 
Javascript :: display component in popup angular 8 
Javascript :: how to change Mime type of a file express 
Javascript :: js while loop 
Javascript :: every element in list after first javascript 
Javascript :: javascript function hoisting 
Javascript :: json in python 
Javascript :: multer gridfs storage 
Javascript :: addeventlistener js 
Javascript :: resize canvas 
Javascript :: unshift javascript 
Javascript :: change direction in material ui 
Javascript :: require vs import 
Javascript :: oops in js 
Javascript :: get vue-emoji-picker 
Javascript :: pass a function as a parameter in other function 
Javascript :: event loop javascript 
Javascript :: fastest way to check a number is palindrome 
Javascript :: Destructuring of array in ES6 
Javascript :: google analytics nextjs 
Javascript :: javascript add method to a class 
Javascript :: javascript Arrow Function with No Argument 
Javascript :: scss variables in react 
Javascript :: javascript object prototype 
Javascript :: update data in sequelize 
Javascript :: interval in javascript 
ADD CONTENT
Topic
Content
Source link
Name
1+4 =