-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreact.html
More file actions
32 lines (28 loc) · 1.31 KB
/
react.html
File metadata and controls
32 lines (28 loc) · 1.31 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<head>
<link rel="stylesheet" href="style.css">
<meta name="viewport" content="width=device-width",initial-scale="1">
</head>
<body>
<div id="app"></div>
</body>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/16.8.4/umd/react.development.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-dom/16.8.4/umd/react-dom.development.js"></script>
<script>const h= React.createElement;</script>
<script src="https://unpkg.com/babel-standalone/babel.js"></script>
<script src="ButtonModel.js"></script>
<script src="ButtonPresenter.js"></script>
<script src="view/MyButtonView.js" type="text/jsx"></script>
<script src="react/MyButton.js"></script>
<script type="text/jsx">
function click(id){
document.getElementById(id).innerHTML=" clicked!";
setTimeout(()=>document.getElementById(id).innerText="", 300);
}
ReactDOM.render(
<div>
<MyButton onClick={e=>click("myButtonClick")}>My Button</MyButton><span id="myButtonClick" style={{width:100, display: "inline-block"}}></span>
<button onClick={e=>click("nativeButtonClick")}>Native Button</button><span id="nativeButtonClick" style={{width:100, display: "inline-block"}}> </span>
</div>
, document.body.querySelector("#app"));
</script>
<script src="debugMouseKeyboard.js"></script>