Skip to content

Conversation

@Zaimwa9
Copy link
Contributor

@Zaimwa9 Zaimwa9 commented Oct 30, 2025

Closes #347
Problem
When initial fetching of flags failed using one of the lib react hook (500, 403), the promise rejection is unhandled, causing console errors and surfacing the error to the parent app.

Changes

  • Added .catch in react.tsx when calling init to prevent unhandled rejections
  • emit an event to update react hooks
  • Ensure flags default or disabled if not provided
  • Error captured in loadingState.error

Test

  • Added a test covering the case

Before fix:
image

After fix:
image

@Zaimwa9 Zaimwa9 requested a review from a team as a code owner October 30, 2025 10:04
@Zaimwa9 Zaimwa9 requested review from talissoncosta and removed request for a team October 30, 2025 10:04
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.

[React] FlagsmithProvider throws error when flagsmith.init fails by some reason to fetch flags

2 participants