-
Notifications
You must be signed in to change notification settings - Fork 44
fix: catch init error in useFlagsmith #351
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
Conversation
talissoncosta
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good overall. Let's just check the ; usage.
…fix/catch-init-error-in-use-flagsmith
|
@talissoncosta, removed trailing comma and semi-colon from linter configuration. The diff is only coming from the linter in the new commit. |
|
@Zaimwa9 thanks for handling that. It looks pretty good to me. |
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
.catchinreact.tsxwhen calling init to prevent unhandled rejectionseventto update react hooksloadingState.errorTest
Before fix:

After fix:
