1.0.3 • Published 3 years ago
react-router-dom-fix v1.0.3
react-router-dom-fix
My personal react-router-dom adapter, only a few available.
I did this because I didn't want the navigate function in the GNB menu to keep re-rendering when the URL sub-address changed.
- If the address changes,
useNavigateFix()will not invoke the re-render.
Warning: I haven't had any problems yet, but you have to be careful.
- In problematic situations, you can use
useNavigate()instead ofuseNavigatefix().
Install
npm install react-router-dom-fixUsage
const navigate = useNavigateFix() // or useNavigate();export
export {
BrowserRouterFix,
useNavigateFix,
Routes,
Route,
useLocation
useNavigate,
}License
MIT © stacew