cool-airline-75608
01/06/2023, 1:29 PMfresh-football-47124
getFeatureValue("my-feature", 123)
cool-airline-75608
01/06/2023, 1:44 PMgetFeatureValue("my-feature", 123)
may return different values in the two renderings of the test component; the UI of the page will also change accordingly. This is something we don't want to see.fresh-football-47124
cool-airline-75608
01/10/2023, 7:47 AMswift-helmet-3648
01/10/2023, 8:27 PMcatch
statement to handle that case.
fetch(FEATURES_ENDPOINT)
.then((res) => res.json())
.then((json) => {
gb.setFeatures(json.features);
})
.catch((e) => {
// notify error reporting e.g. sentry
});
As for flickering UI, there are a couple ways to address this. The ideal way would be to have a server-side rendering (SSR) solution. Frameworks like Next.js provide this out of the box. With Next, you should be able to evaluate features on the server-side before sending a payload to the client. Let me know if you have any more questions about this!cool-airline-75608
01/11/2023, 1:26 AMfetch(FEATURES_ENDPOINT)
.then((res) => res.json())
.then((json) => {
gb.setFeatures(json.features);
})
.catch((e) => {
// notify error reporting e.g. sentry
gb.setFeatures(FallbackFeatures);
});
This scheme obviously has many disadvantages.happy-autumn-40938
01/15/2023, 8:20 AM