React 绑定事件监听函数
作者:互联网
index.js
import React from 'react'
import ReactDOM from 'react-dom'
class Btn extends React.Component {
render() {
return <button onClick={() => alert('click')}>click</button>
}
}
ReactDOM.render(<Btn />, document.getElementById('root'))
标签:react,render,绑定,click,React,import,监听,ReactDOM 来源: https://www.cnblogs.com/aisowe/p/15245843.html