fetch('http://www.baidu.com?r_userName='+forData.r_userName+'&r_password='+forData.r_password+'&r_confirm='+forData.r_confirm,myFetchOptions).
then(response=>response.json()).then(json={
this.setState({userNickName:json.NickUserName,userid:json.UserId});
});
调用fetch方法,里面写入 this.setState这个方法的时候,程序报错。错误信息是如下:

轻松入门 React 开发,React Router 4 与 Webpack 2 完美升级项目
了解课程