react引入方式

时间:2023-12-15 11:31:02
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<script src="../redux/node_modules/react/umd/react.development.js"></script>
<script src="../redux/node_modules/react-dom/umd/react-dom.development.js"></script>
<script src="https://unpkg.com/babel-standalone@6.15.0/babel.min.js"></script>
<script type="text/babel">
class App extends React.Component{
render(){
return(
<div>66666</div>
)
}
}
window.onload=function(){
let titl =document.getElementById("div1");
ReactDOM.render(
<App/>,
titl
)
}
//document.getElementById()
</script>
</head>
<body>
<div id="div1">
</div>
</body>
</html>