configureUrlQuery(config)
This function configures the singleton instance of React URL Query. The available options to configure are:
history
(Object): Must be provided unless using React Router v4. This object should provide two functions:push(location)
andreplace(location)
that update the URL based on thelocation
provided.addUrlChangeHandlers
(Boolean): If true, adds generated URL change handlers when usingaddUrlProps
with aurlPropsQueryConfig
. Defaults totrue
.addRouterParams
(Boolean): If true, lifts values fromprops.params
provided by React Router to directprops
when usingaddUrlProps
. Defaults totrue
.changeHandlerName
(Function): Specifies how change handler names are generated whenaddUrlChangeHandlers
is set totrue
. By default, mapspropName
toonChangePropName
.readLocationFromStore
(Function): Reads inlocation
from the Redux store if available and passes it to the reducer inurlQueryMiddleware
. This property is only used when the middleware is added to Redux, as in this example. Defaults to reading fromstate.routing.locationBeforeTransitions
, the standard location for react-router-redux.
Arguments
options
(Object): The options to update in the configuration.
Returns
(void): It does not return anything.
Remarks
- If you are using React Router v4, instead of configuring the
history
option here, useRouterToUrlQuery
. All other options can still be configured normally.
Examples
import { browserHistory } from 'react-router'; // v2
configureUrlQuery({
history: browserHistory,
addRouterParams: false,
});