<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>函数式组件绑定事件.html</title>
<script crossorigin src="https://unpkg.com/react@16/umd/react.development.js"></script>
<script crossorigin src="https://unpkg.com/react-dom@16/umd/react-dom.development.js"></script>
</head>
<body>
<div id="app">
</div>
</body>
<script src="https://cdn.bootcdn.net/ajax/libs/babel-standalone/7.0.0-beta.3/babel.min.js"></script>
<script type="text/babel">
function go() {
console.log("gogogo")
}
let item = () => {
return (
<div className="item">
<button onClick={ go }>点击一下</button>
<button onClick={ go() }>点击一下</button> {}
<hr/>
</div>
)
}
ReactDOM.render(item(), document.getElementById("app"))
</script>
</html>