react directly in html

Solutions on MaxInterview for react directly in html by the best coders in the world

showing results for - "react directly in html"
Irene
21 Apr 2020
1<!DOCTYPE html>
2<html>
3  <script src="https://unpkg.com/react@16/umd/react.production.min.js"></script>
4  <script src="https://unpkg.com/react-dom@16/umd/react-dom.production.min.js"></script>
5  <script src="https://unpkg.com/babel-standalone@6.15.0/babel.min.js"></script>
6  <body>
7  
8    <div id="mydiv"></div>
9
10    <script type="text/babel">
11      class Hello extends React.Component {
12        render() {
13          return <h1>Hello World!</h1>
14        }
15      }
16
17      ReactDOM.render(<Hello />, document.getElementById('mydiv'))
18    </script>
19  </body>
20</html>