From 30b2091b97218a03a3d19c0b6c8db1995319f158 Mon Sep 17 00:00:00 2001 From: Stefano Pigozzi Date: Sun, 10 Oct 2021 17:02:05 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Fix=20ResourceRouter,=20as=20the?= =?UTF-8?q?=20previous=20behaviour=20is=20no=20longer=20needed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- frontend/src/components/routing/ResourceRouter.tsx | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/frontend/src/components/routing/ResourceRouter.tsx b/frontend/src/components/routing/ResourceRouter.tsx index b8a4cce..effab7d 100644 --- a/frontend/src/components/routing/ResourceRouter.tsx +++ b/frontend/src/components/routing/ResourceRouter.tsx @@ -24,7 +24,6 @@ export function ResourceRouter({selection, unselectedRoute, selectedRo const UnselectedRoute = unselectedRoute const SelectedRoute = selectedRoute - // This component **intentionally** has a incomplete dependency array to avoid routes being re-rendered every time the parent changes. return React.useMemo( () => { if(selection) { @@ -36,7 +35,6 @@ export function ResourceRouter({selection, unselectedRoute, selectedRo ) }, - // eslint-disable-next-line react-hooks/exhaustive-deps - [selection], + [selection, selectedRoute, unselectedRoute], ) }