The new useExperiment() hook will return a list of enabled experiments, so any component that wants to conditionally show UI based on an experiment flag can call this hook:
function ExperimentalFeatureUI() {
const showNewFeature = useExperiment("pineapple-smoothie");
if (showNewFeature === true) {
return <h1>Hi, I am an experimental feature</h1>;
} else {
return null;
}
}
Allow experiments set with
firebase experiments:enable
to be accessed by the emulator UI. Corresponding CLI PR: https://github.com/firebase/firebase-tools/pull/6169The new
useExperiment()
hook will return a list of enabled experiments, so any component that wants to conditionally show UI based on an experiment flag can call this hook: