launchdarkly client-side ID
the initial LaunchDarkly context
Optional options: LDReactProviderOptionsoptional provider and client options
Optional The LaunchDarkly React Client provider.
import { createLDReactProvider } from '@launchdarkly/react-sdk';
const LDProvider = createLDReactProvider('your-client-side-id', { kind: 'user', key: 'user-key' });
function Root() {
return (
<LDProvider>
<App />
</LDProvider>
);
}
Generated using TypeDoc
Creates a new LaunchDarkly React provider, creating the client internally.
By default the client is started immediately (before the provider mounts). Pass
deferInitialization: truein options to opt out of auto-start and callclient.start()yourself viauseLDClient().