Hook to check if a feature is enabled for the current context.
This hook uses the FeatureReader from the nearest FeatureReaderProvider.
FeatureReader
FeatureReaderProvider
Unique name of the feature to check
Optional
Optional configuration (e.g., inversion)
Boolean representing if feature is enabled, or null while loading
const isEnabled = useFeatureEnabled('new_checkout_flow');if (isEnabled === null) return <Spinner />;return isEnabled ? <NewCheckout /> : <OldCheckout />; Copy
const isEnabled = useFeatureEnabled('new_checkout_flow');if (isEnabled === null) return <Spinner />;return isEnabled ? <NewCheckout /> : <OldCheckout />;
Hook to check if a feature is enabled for the current context.
This hook uses the
FeatureReaderfrom the nearestFeatureReaderProvider.