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
Post a Comment