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

RFC: Add generic type to useFlags #139

Open
jamiehaywood opened this issue Jul 11, 2022 · 3 comments
Open

RFC: Add generic type to useFlags #139

jamiehaywood opened this issue Jul 11, 2022 · 3 comments

Comments

@jamiehaywood
Copy link

Is your feature request related to a problem? Please describe.
It would be great to get intellisense when destructuring the flags from useFlags

Describe the solution you'd like
To pass a generic to the useFlags hook:

interface Flags {
  featureFlagOne: boolean
}

const { featureFlagOne } = useFlags<Flags>()
@yusinto
Copy link
Contributor

yusinto commented Jul 13, 2022

Thank you for requesting this. This makes sense. We'll raise this internally and I'll update this issue when there's one.

@jamiehaywood
Copy link
Author

thanks @yusinto - I'm happy to write a PR to support this, just wanted to get validation around the idea.

@yusinto
Copy link
Contributor

yusinto commented Jul 21, 2022

@jamiehaywood a PR will be super! Thank you for this.

ewlsh added a commit to ewlsh/react-client-sdk that referenced this issue Aug 30, 2022
Convert to function to allow overrides

Closes launchdarkly#139
ewlsh added a commit to ewlsh/react-client-sdk that referenced this issue May 8, 2024
Convert to function to allow overrides

Closes launchdarkly#139
ewlsh added a commit to ewlsh/react-client-sdk that referenced this issue May 8, 2024
Convert to function to allow overrides

Closes launchdarkly#139
ewlsh added a commit to ewlsh/react-client-sdk that referenced this issue May 8, 2024
Convert to function to allow overrides

Closes launchdarkly#139
ewlsh added a commit to ewlsh/react-client-sdk that referenced this issue Sep 10, 2024
Convert to function to allow overrides

Closes launchdarkly#139
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