Skip to content

React: support multiple contexts #300

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

Open
kyle-ssg opened this issue Mar 27, 2025 · 0 comments
Open

React: support multiple contexts #300

kyle-ssg opened this issue Mar 27, 2025 · 0 comments

Comments

@kyle-ssg
Copy link
Member

kyle-ssg commented Mar 27, 2025

The core sdk allows you to use multiple flagsmith instances via creatFlagsmithInstance(), however the provider only allows for 1 single instance. Instead we should allow defining a "domain" as openfeature calls it.

Proposed syntax: note this suggestion adds an overload where useFlags takes an object rather than passing yet another parameter, we can keep this backwards compatible.

<FlagsmithProvider domain="a"> // since openfeature calls it a domain

useFlags({flags:[],domain:"a"})
useFlagsmith({domain:"a"})
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

1 participant