Skip to content

Commit

Permalink
fix: workaround for user login breaking app routing in certain cases (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
aeharding authored Nov 14, 2024
1 parent ab25fb9 commit ac38687
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/routes/TabbedRoutes.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,13 @@ function InnerTabbedRoutes({
if (pathnameSections <= 1) return;

function push() {
router.push(`/${tabRef?.current || "posts"}`, "none", "push");
// TODO requestAnimationFrame workaround added for regression caused in react 19 upgrades,
// broke right after eda26916b56ca0593f4711516a3ef3048f75fbb6. needs investigation
// repro: be completely logged out. restart app. login. go to a post, go back,
// repeat navigations, see issue
requestAnimationFrame(() => {
router.push(`/${tabRef?.current || "posts"}`, "none", "push");
});
}

// have to wait for the ActorRedirect to do its thing, so it doesn't get clobbered
Expand Down

0 comments on commit ac38687

Please sign in to comment.