react-client-sdk
react-client-sdk copied to clipboard
RFC: Add generic type to `useFlags`
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>()
Thank you for requesting this. This makes sense. We'll raise this internally and I'll update this issue when there's one.
thanks @yusinto - I'm happy to write a PR to support this, just wanted to get validation around the idea.
@jamiehaywood a PR will be super! Thank you for this.