Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(loading): Prevent isLoading from being true with fallbackData #4140

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Conqxeror wants to merge 4 commits into vercel:main
base: main
Choose a base branch
Loading
from Conqxeror:fix/loading-state-fallback

Conversation

@Conqxeror
Copy link

@Conqxeror Conqxeror commented Jun 28, 2025

This PR addresses an issue where isLoading was incorrectly set to true even when fallbackData was provided, particularly in SSR scenarios. This led to a "flash of skeleton" UI, which is undesirable when initial data is already available.

The change modifies the logic to ensure that isLoading remains false when fallbackData is present, while isValidating correctly reflects the background revalidation process. This allows the initial server-cached data to be displayed immediately, providing a smoother user experience.

Fixes #3046

Conqxeror added 4 commits June 29, 2025 04:33
When `fallbackData` is provided, `isLoading` should not be true initially.
Instead, `isValidating` should be true to indicate background revalidation.
This prevents a "flash of skeleton" UI when initial data is available.
Fixes vercel#3046 
When `fallbackData` is provided, `isLoading` should not be true initially.
Instead, `isValidating` should be true to indicate background revalidation.
This prevents a "flash of skeleton" UI when initial data is available.
Fixes vercel#3046 
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Copy link
Member

shuding commented Jul 19, 2025

Would love to have a test case for this, thanks!

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

Reviewers

@shuding shuding Awaiting requested review from shuding shuding is a code owner

@huozhi huozhi Awaiting requested review from huozhi huozhi is a code owner

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

revalidateOnMount With Fallback triggers isLoading instead of isValidating

AltStyle によって変換されたページ (->オリジナル) /