An easy way to treat a state array as immutable these days is: let list = Array.from(this.state.list); list.push('woo'); this.setState({list}); ...
確定! 回上一頁