Skip to content

Instantly share code, notes, and snippets.

@hackingbeauty
Last active April 6, 2018 17:15
Show Gist options
  • Save hackingbeauty/af72ad32a5504191b4f4964d5c6ac7f0 to your computer and use it in GitHub Desktop.
Save hackingbeauty/af72ad32a5504191b4f4964d5c6ac7f0 to your computer and use it in GitHub Desktop.
/* In src/core/utils create a file called routing.js and add this code (I'm assuming you're using hash-based URLs) */
import { createHashHistory } from 'history'
export default createHashHistory()
/* Then, in your Action Creators, import this file and you can use React-Router to navigate programatically */
import history from 'core/utils/routing'
...
history.push('/your-route')
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment