Here's a look at the top-level exports in src/index.js
:
// History API
export { createBrowserHistory } from './history';
export { startListener } from './listener';
// Redux API
export { PUSH, REPLACE, GO, GO_BACK, GO_FORWARD, LOCATION_CHANGE } from './constants';
export { push, replace, go, goBack, goForward, locationChange } from './actions';
export { routerMiddleware } from './middleware';
export { routerReducer } from './reducer';
push()
,replace()
,go()
,goBack()
,goForward()
- Public action creators used to update the location.
- Use these navigation actions instead of calling the
history
navigation methods directly!
location_Change()
- The action dispatched by
startListener
. (Don't use this!)
- The action dispatched by
PUSH
,REPLACE
,GO
,GO_BACK
,GO_FORWARD
,LOCATION_CHANGE
- Public action types for use in user-defined middleware.
routerMiddleware(history)
- Intercepts the navigation actions to update the browser history.
routerReducer
- Adds the location data (
pathname
,search
,hash
) to the state tree upon receiving aLOCATION_CHANGE
action.
- Adds the location data (
createBrowserHistory()
- Creates a
history
object.
- Creates a
startListener(history, store)
- Creates a
history
listener that responds to the middleware and external navigation by dispatching alocationChange
action.
- Creates a