Skip to content

Instantly share code, notes, and snippets.

@h26k2
Created August 4, 2019 12:05
Show Gist options
  • Save h26k2/331b3e72c61a4421184e29e2882677a3 to your computer and use it in GitHub Desktop.
Save h26k2/331b3e72c61a4421184e29e2882677a3 to your computer and use it in GitHub Desktop.
programmatically redirects REACT
// for redirect to a page
this.props.history.push({
pathname : '/signin'
})
//for redirect to a page with query parameters
this.prosp.history.push({
pathname: '/events',
search: '?category=all'
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment