If you have any project questions, concerns, or contribution ideas, join our #pwa Slack channel. Find out how to create an account by visiting Community Resources



A React Hook that gets a search parameter from a URL and calls a provided setter function with the corresponding value.

Kind: global function

Param Type Description
props Object An object containing the location, parameter, and setter function.
props.location String The URL location to search in
props.parameter String The parameter to search for
props.setValue function A setter function that is passed the parameter value found in the URL

For implementation details View Source.


The following example, uses the useSearchParam() hook to get the query parameter from the URL.