Read a flag
useFlag(key, fallback?) returns a boolean. The component re-renders when a sync or a user change changes the value.
What you get before anything has loaded
On the first frame the client has not read AsyncStorage yet, so useFlag returns the fallback (false by default). The local read takes milliseconds; once it finishes, reads come from the saved snapshot. A snapshot that does not contain the flag also returns the fallback.
Turning it on
Enable the flag in the dashboard. Phones pick up the new revision on their next sync: at startup, when the app returns to the foreground, after identify, or when your app calls refresh(). See Refresh.
Declarative alternatives
<Flag>, <Switch> and <Experiment> are each one useFlag plus a branch, so they record exposure the same way. See Components.
Checking why
See explain().