Skip to content

Instantly share code, notes, and snippets.

@VithuJey
Last active Oct 22, 2021
Embed
What would you like to do?
Just a gist to explain React Router
<Route path="/search" children={<Search />} />
...
<Link to={`/search?category=${cat}&bundle=${bund}`}>Search</Link>
...
let location = useLocation();
console.log(location)
/*
{
pathname: '/search',
search: '?category=grocery&bundle=b156',
hash: '',
state: undefined
}
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment