Last active
October 22, 2021 06:26
-
-
Save VithuJey/71ba9cd292030193f00a00d612f720a3 to your computer and use it in GitHub Desktop.
Just a gist to explain React Router
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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