useSearchState(
// Send any state to the search/query string
// Changing this value will cause a pushState()
{
foo: 123,
bar: 42,
},
// Handle changes in the search/query string
// (called once for the initial page load, and for
// subsequent changes including on forward/back
// navigation by the user)
({ foo, bar }) => {
// For example, copy to local state:
// setFoo(foo)
// setBar(bar)
}
);