对不起,是否已经询问我是否尝试过现有答案
export default class Social extends Component {
constructor (){
super()
this.state = {
Loggedin : false,
Userinfo : []
}
}
viewAbout() {
// this.context.router.history.push('/Profile')
GoogleAuth(pro)
function pro () {
console.log('pro')
//console.log(this.state.Userinfo)
var userstring = JSON.stringify(user)
console.log(userstring)
this.setState({user:userInfo}, () => {
console.log('new info', this.state.userInfo)
});
}
}
pro功能是从google auth中执行的,它登录了pro,但没有在console中记录新信息,这是我错了