Client-Side Rendering

This demo is easiest to understand if you open its source code in a parallel tab.

Source code

This demo shows how to use @happykit/flags for regular pages.

In this configuration, the feature flags will be loaded when the client renders the page. They will not be loaded at build time. Check the Static Site Generation examples if you need that, or the Server-Side Rendering examples.

When the page mounts, @happykit/flags will fetch the latest flags from the server and render the page accordingly.

The settled value will then flip to true after the evaluation on the client finishes.

Render #1 (Current render)
{ flags: null, data: null, error: null, fetching: false, settled: false, visitorKey: null }