1
Fork 0
mirror of https://github.com/Steffo99/sophon.git synced 2024-12-23 07:14:21 +00:00

🔧 Fix ResourceRouter, as the previous behaviour is no longer needed

This commit is contained in:
Steffo 2021-10-10 17:02:05 +02:00
parent 54dbb35724
commit 53b62f92ac
Signed by: steffo
GPG key ID: 6965406171929D01

View file

@ -24,7 +24,6 @@ export function ResourceRouter<Resource>({selection, unselectedRoute, selectedRo
const UnselectedRoute = unselectedRoute const UnselectedRoute = unselectedRoute
const SelectedRoute = selectedRoute 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( return React.useMemo(
() => { () => {
if(selection) { if(selection) {
@ -36,7 +35,6 @@ export function ResourceRouter<Resource>({selection, unselectedRoute, selectedRo
<UnselectedRoute/> <UnselectedRoute/>
) )
}, },
// eslint-disable-next-line react-hooks/exhaustive-deps [selection, selectedRoute, unselectedRoute],
[selection],
) )
} }