- npm i react-router-dom
- detail on documentation of react-router-dom
- Link tag is equal to a tag
- a tag refresh the page so in reactwe use link which don't refresh the page
- link atribute us to=""
- NavLink is similar to Link but have extra feature like isActive can use for identify if the url is active or not
- for router dom you need to give main app the with the prop otherwise it will not work, so you need to create router constant and put the value of createBrowserRouter.
- there are twoo ways of doing routing check in main.jsx file.
- can help in changing the page on same file see in Layout.jsx
- with the help of loader better optimization happen than useEffect . it fetch the api before the clicking just by hovering and also save it in cache.
oroxhimaru / react-router-project Goto Github PK
View Code? Open in Web Editor NEWProject is based on react router dom, with useParams and userLoaderData hooks. and the use of classname in ()=> this way