launchdarkly client instance
Optional ReactContext: Context<LDReactClientContextValue>optional launchdarkly react context
Optional The LaunchDarkly React Client provider.
NOTE: We recommend using the factory function createLDReactProvider instead of this function if you can.
This factory function is provided to allow the caller to use an existing client
instance. When using this function, the caller is responsible for calling client.start()
before or after mounting.
import { createClient, createLDReactProviderWithClient, initLDReactContext } from '@launchdarkly/react-sdk';
const client = createClient(clientSideID, context);
client.start();
const LDProvider = createLDReactProviderWithClient(client);
For multiple client instances, pass a custom React context:
const ReactContext = initLDReactContext();
const LDProvider = createLDReactProviderWithClient(client, ReactContext);
Generated using TypeDoc
Creates a new LaunchDarkly React provider wrapping an existing client instance.