launchdarkly / react-client-sdk

LaunchDarkly Client-side SDK for React.js
Other
86 stars 68 forks source link

Allow manual initialisation of flags in LDProvider #128

Closed stanlindsey-etch closed 2 years ago

stanlindsey-etch commented 2 years ago

Pre-rendering flags in the react application is difficult, i'd love to be able to pre-set some inital flags in SSR or initial render e.g. <LDProvider initialFlags={["myFlagX", "myflagY"]}

Related to https://github.com/launchdarkly/react-client-sdk/issues/30 which is solved with a Mock context.

louis-launchdarkly commented 2 years ago

Hello @stanlindsey-etch, thank you for reaching out. We have chatted about your request, and we are wondering does the Bootstrapping feature in React SDK would work for your use case. Here is the documentation for it: https://docs.launchdarkly.com/sdk/features/bootstrapping#react

Please let us know does this solves your use case or not.