React URL Query provides a number of top-level exports.
- Serialize
- decode(type, encodedValue, [defaultValue]), alias of Serialize.decode for convenience
- encode(type, valueToEncode), alias of Serialize.encode for convenience
- urlQueryDecoder(config)
- urlQueryEncoder(config)
- replaceInUrlQuery(queryParam, encodedValue, [location])
- pushInUrlQuery(queryParam, encodedValue, [location])
- replaceUrlQuery(newQuery, [location])
- pushUrlQuery(newQuery, [location])
- multiReplaceInUrlQuery(queryReplacements, [location])
- multiPushInUrlQuery(queryReplacements, [location])
Note that these helpers are provided in the event you would like to use Redux's dispatch
to update the URL. They are not necessary for using React URL Query with Redux. Compare the example without using dispatch with the example using dispatch.
- replaceInUrlQueryFromAction(action, [location])
- replaceUrlQueryFromAction(action, [location])
- pushInUrlQueryFromAction(action, [location])
- pushUrlQueryFromAction(action, [location])
- urlAction(actionType, payload, [meta])
- urlReplaceInAction(actionType, queryParam, valueType)
- urlPushInAction(actionType, queryParam, valueType)
- urlReplaceAction(actionType, [encodeQuery])
- urlPushAction(actionType, [encodeQuery])
- urlQueryMiddleware([options])
- urlQueryReducer(action, [location])
You can import any of the Top-Level Exports as follows:
import { addUrlProps } from 'react-url-query'