Created
February 5, 2017 15:33
-
-
Save juusaw/904dbb92dc4bc8690cd421faabf2bfb2 to your computer and use it in GitHub Desktop.
Action creator for react-router-redux path change
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { push } from 'react-router-redux' | |
/** | |
* Action creator to perform a route change from a component. | |
* Simply pass the action creator to the component and call it | |
* like `this.props.routePath('/route/here')` | |
* | |
* @param {string} path The path to navigate to. | |
* | |
* @return {Object} Action to dispatch for route change. | |
*/ | |
export function routePush(path) { | |
return push(path) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment