useFlags is a custom hook which returns all feature flags. It uses the useContext primitive
to access the LaunchDarkly context set up by withLDProvider. As such you will still need to
use the withLDProvider HOC at the root of your app to initialize the React SDK and populate the
context with ldClient and your flags.
useFlags
is a custom hook which returns all feature flags. It uses theuseContext
primitive to access the LaunchDarkly context set up bywithLDProvider
. As such you will still need to use thewithLDProvider
HOC at the root of your app to initialize the React SDK and populate the context withldClient
and your flags.