A React Hook that gets a search parameter from a URL and calls a provided setter function with the corresponding value.
Parameters
Name
Type
Description
props
ObjectAn object containing the parameter and setter function.
props.parameter
StringThe parameter to search for
props.setValue
functionA setter function that is passed the parameter value found in the URL
Source Code: pwa-studio/packages/peregrine/lib/hooks/useSearchParam.js