Use when feature flag tests fail, flags need updating, understanding @gate pragmas, debugging channel-specific test failures, or adding new flags to React.
Manage React feature flags across channels, gate tests conditionally, and debug flag-specific test failures. Four flag files control defaults and channel-specific overrides (canary, www, React Native, test renderer) with __VARIANT__ flags simulating gatekeepers tested in both states Use @gate flagName pragma to skip tests entirely when a flag is unavailable, or inline gate() to branch assertions when behavior differs Adding a new flag requires entries in the main file plus all fork files; set to __VARIANT__ in www/native-fb forks if the flag should vary by channel Common pitfalls include forgetting to test both __VARIANT__ states, using @gate for behavior differences instead of inline gate(), and omitting fork file entries React Feature Flags Flag Files File Purpose packages/shared/ReactFeatureFlags.js Default flags (canary), __EXPERIMENTAL__ overrides packages/shared/forks/ReactFeatureFlags.www.js www channel, __VARIANT__ overrides packages/shared/forks/ReactFeatureFlags.native-fb.js React Native, __VARIANT__ overrides packages/shared/forks/ReactFeatureFlags.test-renderer.js Test renderer Gating Tests @gate pragma (test-level) Use when the feature is completely unavailable without the flag:
don't have the plugin yet? install it then click "run inline in claude" again.