【发布时间】:2019-05-18 03:49:19
【问题描述】:
我想将状态值的一些细节保存到 Firestore。我怎样才能做到这一点?
状态详情
state = {
loading: false,
sp_name: '',
sp_Phone: '',
sp_Role: '',
sp_Location: '',
sp_Service: '',
sp_country: '',
sp_message: '',
sp_License: ''
}
我不想将加载状态保存到 Firestore。
处理提交事件。
handleSubmit = (e) => {
e.preventDefault();
this.setState({ loading: true })
let uid = this.props.auth.uid;
this.props.UpdateUser(uid, this.state)
this.setState({ loading: false })
toast("Registered Successfully.!", { type: toast.TYPE.INFO, autoClose: 5000 });
}
【问题讨论】: