![Why useNavigate hook in react-router v6 triggers waste re-renders and how to solve it | ShallowDepth Why useNavigate hook in react-router v6 triggers waste re-renders and how to solve it | ShallowDepth](https://shallowdepth.online/posts/2022/04/why-usenavigate-hook-in-react-router-v6-triggers-waste-re-renders-and-how-to-solve-it/code.png)
Why useNavigate hook in react-router v6 triggers waste re-renders and how to solve it | ShallowDepth
![reactjs - useNavigate() may be used only in the context of a <Router> component is the error that I'm getting in the console - Stack Overflow reactjs - useNavigate() may be used only in the context of a <Router> component is the error that I'm getting in the console - Stack Overflow](https://i.stack.imgur.com/clXZc.png)
reactjs - useNavigate() may be used only in the context of a <Router> component is the error that I'm getting in the console - Stack Overflow
![Why useNavigate hook in react-router v6 triggers waste re-renders and how to solve it | ShallowDepth Why useNavigate hook in react-router v6 triggers waste re-renders and how to solve it | ShallowDepth](https://shallowdepth.online/posts/2022/04/why-usenavigate-hook-in-react-router-v6-triggers-waste-re-renders-and-how-to-solve-it/github-comment.png)
Why useNavigate hook in react-router v6 triggers waste re-renders and how to solve it | ShallowDepth
![Why useNavigate hook in react-router v6 triggers waste re-renders and how to solve it | ShallowDepth Why useNavigate hook in react-router v6 triggers waste re-renders and how to solve it | ShallowDepth](https://screenshots.codesandbox.io/ujor17/179.png)