diff --git a/frontend/src/components/routing/ResourceRouter.tsx b/frontend/src/components/routing/ResourceRouter.tsx index 03e6578..a032f85 100644 --- a/frontend/src/components/routing/ResourceRouter.tsx +++ b/frontend/src/components/routing/ResourceRouter.tsx @@ -30,12 +30,14 @@ export interface ResourceRouterProps({selection, unselectedRoute: UnselectedRoute, selectedRoute: SelectedRoute}: ResourceRouterProps): JSX.Element { + // This component **intentionally** has a incomplete dependency array to avoid routes being re-rendered every time the parent changes. return React.useMemo( () => { if(selection) { @@ -47,6 +49,7 @@ export function ResourceRouter({selection, unselectedRoute: UnselectedRout ) }, - [selection, UnselectedRoute, SelectedRoute], + // eslint-disable-next-line react-hooks/exhaustive-deps + [selection], ) }