Only handle idle history events (#1872)

only handle idle history events
This commit is contained in:
Brendan Allan 2023-12-07 20:10:21 +11:00 committed by GitHub
parent 1db2a4eccc
commit cd32f530d6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -95,6 +95,9 @@ function AppInner() {
const router = createMemoryRouterWithHistory({ routes, history });
const dispose = router.subscribe((event) => {
// we don't care about non-idle events as those are artifacts of form mutations + suspense
if (event.navigation.state !== 'idle') return;
setTabs((routers) => {
const index = routers.findIndex((r) => r.router === router);
if (index === -1) return routers;