code
<! DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, "> <title>Hello_React</title> </head> <body> <! <div id="test"> </div> <! <script SRC =".. /js/react.development.js"></script> <! <script SRC ="... /js/react-dom.development.js"></script> <! <script SRC =".. /js/babel.min.js"></script> <script type="text/ Babel "> </h1>; / / DOM to page rendering virtual ReactDOM. Render (VDOM, document. GetElementById (" test ")); </script> </body> </html>Copy the code
Implementation effect
Matters needing attention
- React-related library files are introduced in sequence, starting with React. development, then dom, then Babel.
- Assignments to the virtual DOM are not quoted.