reactjs - Redirecting to a Users Home Page with React upon Login -




i building first react app,

currently trying redirect user home page after putting in login credentials.

my click handler redirecting them root page, doesn't set user experience. want them render show page.

handlesubmit(e) {   e.preventdefault();   const user = object.assign({}, this.state);   this.props.form(user)     .then(       () => {         this.props.history.push('/');       }     ); } 

i changed .push to,

this.props.history.push(`/api/users/${user.id}`) 

user in case routing /api/users/undefined..

the login works, because log user in , renders root afterward.

i have working user show page shows users profile.

any direction appreciated.





wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -