react报错:Can’t perform a React state update on an unmounted component
componentDidMount = () => {
$.ajax(‘你的请求’,{})
.then(res => {
this.setState({
data: datas,
});
})
.catch(error => {
});
}
componentWillUnmount = () => {
this.setState = (state,callback)=>{
return;
};
}