Skip to content
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

useFlags not updating values in react18/Nextjs App Router #214

Closed
kyle-ssg opened this issue Feb 20, 2024 · 0 comments
Closed

useFlags not updating values in react18/Nextjs App Router #214

kyle-ssg opened this issue Feb 20, 2024 · 0 comments
Assignees

Comments

@kyle-ssg
Copy link
Member

kyle-ssg commented Feb 20, 2024

I believe #188 attempted to solve this, however the following project does not see new values for useFlags Flagsmith/flagsmith-js-examples#8. Essentially in the current live version of the SDK events.off('event', eventListener) is removing more than 1 event handler.

To get around it, the PR has a version of flagsmith from https://github.com/Flagsmith/flagsmith-js-client/pull/210/files#diff-090ff4f85a594b9bd7b6f1a515395bd0a604ade2c55db3e5c9e7ea76021cbd7fL156 that fixes the issue, but it'd cause a leak due to the removed line.

I cannot figure out the issue, however maybe we need to implement a version of tinyevents that lets you remove the exact event listener that you setup.

i.e.


const remove = events.on('x'...

return ()=> remove()

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

No branches or pull requests

2 participants