I new in React, pls help me. I need to register a new user with api .Backend developer gave me screenshot how he implemented registration on php.Unfortunately he doesn't know react so he can't help me. I already have input forms saving them in state. Could you please help me what's going on in the picture below and how make registration on React.
and my code. Let me know if I missing any field. I have url , but I dont know where to add user/create, company/create links:
signUp(event) {
event.preventDefault()
const formdata = new FormData()
formdata.append("email", this.state.userLogin.email)
formdata.append("password", this.state.userLogin.password)
formdata.append("name", this.state.userLogin.name)
formdata.append("companyName", this.state.userLogin.companyName)
formdata.append("region", this.state.userLogin.region)
axios
.post("http://dev.***********.com/", formdata)
.then(res => {
if (res.data) {
console.log('success')
this.props.history.push("/settings")
}
})
.catch(error => {
console.log(error)
})
}
from User registration with React, Axios and PHP backend
0 komentar:
Posting Komentar