react報錯 TypeError: Cannot read property 'setState' of undefined

代碼如下: class test extends Component { constructor(props) { super(props); this.state = { liked: false }; } handleClick(event) { this.setState({lik
相關文章
相關標籤/搜索