Skip to content

fix: update loadingState when hydrating via serverState#393

Open
Zaimwa9 wants to merge 2 commits intomainfrom
fix/react-hydration-loading-state
Open

fix: update loadingState when hydrating via serverState#393
Zaimwa9 wants to merge 2 commits intomainfrom
fix/react-hydration-loading-state

Conversation

@Zaimwa9
Copy link
Copy Markdown
Contributor

@Zaimwa9 Zaimwa9 commented Apr 20, 2026

Thanks for submitting a PR! Please check the boxes below:

  • I have read the Contributing Guide.
  • I have added information to docs/ if required so people know about the feature.
  • I have filled in the "Changes" section below.
  • I have filled in the "How did you test this code" section below.

Changes

Closes #389

  • flagsmith.setState() now transitions loadingState to {isLoading: false, isFetching: false, source: SERVER} when called with populated flags while still in NONE.
  • Fixes useFlagsmithLoading() getting stuck forever under the documented Next.js/SSR pattern (<FlagsmithProvider serverState={...}> without an options prop).

How did you test this code?

  • Regression test

@Zaimwa9 Zaimwa9 requested a review from a team as a code owner April 20, 2026 14:15
@Zaimwa9 Zaimwa9 requested review from talissoncosta and removed request for a team April 20, 2026 14:15
Copy link
Copy Markdown
Contributor

@talissoncosta talissoncosta left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

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.

useFlagsmithLoading stucks on isLoading when hydrating from serverState alone

2 participants