mirror of
https://github.com/Steffo99/sophon.git
synced 2024-12-22 14:54:22 +00:00
🔧 Fix ResourceRouter, as the previous behaviour is no longer needed
This commit is contained in:
parent
559499ae44
commit
30b2091b97
1 changed files with 1 additions and 3 deletions
|
@ -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],
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue