Skip to content

Hooks

reactpy_router.use_params()

This hook returns an object of key/value pairs of the dynamic parameters from the current URL that were matched by the Route. Child routes inherit all parameters from their parent routes.

For example, if you have a URL_PARAM defined in the route /example/<URL_PARAM>/, this hook will return the URL_PARAM value that was matched.

Returns:

Type Description
dict[str, Any]

A dictionary of the current URL's parameters.

reactpy_router.use_search_params(keep_blank_values=False, strict_parsing=False, errors='replace', max_num_fields=None, separator='&')

This hook is used to read the query string in the URL for the current location.

See urllib.parse.parse_qs for info on this hook's parameters.

Returns:

Type Description
dict[str, list[str]]

A dictionary of the current URL's query string parameters.


Last update: October 14, 2024
Authors: Mark Bakhit