Skip to content

fix(react-router): use queueMicrotask for fireViewReady deferral (setTimeout fallback)#17

Open
olehmisar wants to merge 1 commit intocactuslab:developfrom
olehmisar:fix/view-ready-microtask-fallback
Open

fix(react-router): use queueMicrotask for fireViewReady deferral (setTimeout fallback)#17
olehmisar wants to merge 1 commit intocactuslab:developfrom
olehmisar:fix/view-ready-microtask-fallback

Conversation

@olehmisar
Copy link
Copy Markdown

Problem

Calling fireViewReady after setTimeout(..., 1) deferred the native viewReady signal enough to produce a visible flash when switching native tabs (reported in production FamilyTable builds).

Change

  • Introduce scheduleViewReadyCallback that prefers queueMicrotask so the deferral stays within the same macrotask ordering expectations without the extra timer delay.
  • Fall back to setTimeout(callback, 1) when queueMicrotask is not a function (older runtimes).

Testing

  • pnpm build at repo root (all packages) succeeds.

Made with Cursor

…lback

setTimeout(..., 1) deferred viewReady enough to cause a visible flash after
native tab work. Prefer queueMicrotask when available; fall back to setTimeout
for older runtimes without queueMicrotask.

Made-with: Cursor
@olehmisar
Copy link
Copy Markdown
Author

the PR is generated by AI but the fix is legit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant