Open rrivem opened 4 years ago
Hi @rrivem, just to clarify the issue you're having: you need to know the value of a flag for a major section of your component tree, and the delay in loading the flags is a problem because it briefly renders the wrong content?
If so, perhaps you might benefit from the server-side rendering section of our readme. It describes how to initialize the js client with a previously-loaded set of flag values. This set of values can come from anywhere (webserver, etc) that knows the individual session's unique identifier (the same one you pass into the library), and can load them while serving your initial browser content. Then when the javascript library runs, it will use those values until it gets updates from launchdarkly's service via the js client. Launch darkly also provides useful local proxies for their service, to make certain server response time is minimal even when waiting for their data.
I hope this helps; if not please post as many details as you can so we can figure out how to solve it.
We're using the
FeatureFlag
to render components based on LD flags and works sharp.But now we need to know if we need to avoid rendering a whole tree based on flags and other conditions.
We tried using
ldclient-js
directly, but theinitialize
seems to be affecting theFeatureFlag
rendered items we have already and not being updated when a flag changes.We think we could leverage this by having access to the
ldClientWrapper
to have access to the same ldClient instance used on components