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. -
entrySeparator
(String): Specifies the separator that should be between entries when encoding / decoding. By default_
. -
keyValSeparator
(String): Specifies the separator that should be between key and values when encoding / decoding. By default-
.
options
(Object): The options to update in the configuration.
(void): It does not return anything.
- If you are using React Router v4, instead of configuring the
history
option here, useRouterToUrlQuery
. All other options can still be configured normally.
import { browserHistory } from 'react-router'; // v2
configureUrlQuery({
history: browserHistory,
addRouterParams: false,
});