Skip to content

Conversation

Conqxeror
Copy link

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

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
@Conqxeror Conqxeror requested review from shuding and huozhi as code owners June 28, 2025 23:28
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.

@shuding
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
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

revalidateOnMount With Fallback triggers isLoading instead of isValidating
2 participants