Skip to content

feat: Add react-native-feature-flags plugin (SDK 54+)#307

Closed
huntie wants to merge 1 commit intoexpo:mainfrom
huntie:react-native-feature-flags
Closed

feat: Add react-native-feature-flags plugin (SDK 54+)#307
huntie wants to merge 1 commit intoexpo:mainfrom
huntie:react-native-feature-flags

Conversation

@huntie
Copy link
Copy Markdown

@huntie huntie commented Mar 24, 2026

Why

New config plugin to allow override customisation of ReactNativeFeatureFlags on iOS and Android.

This is intended for advanced users, to opt into individual experimental features (instead of wholesale via release level), or to disable features that conflict with a specific app setup.

⚠️ Important: Features controlled by these low level flags are always experimental and unstable. As documented in the README, this is absolutely a use-at-your-own-risk config plugin that developers should apply carefully.

How

  • Flag names map 1:1 to method names on the base provider class. A compile-time error will surface if a flag doesn't exist in the installed React Native version.
  • Uses dangerouslyForceOverride() on both platforms, since RCTReactNativeFactory (iOS) and Expo's Android setup already call override() during initialization.
  • iOS: Generates separate RNFeatureFlagsOverrideProvider.mm module, imports via the bridging header, and inserts a call into AppDelegate.swift ahead of factory.startReactNative().
  • Android: Inserts imports and an override call into MainApplication.kt after loadReactNative(this) (SoLoader must be initialized first).

Test Plan

See added tests. End-to-end verified locally.

@huntie huntie force-pushed the react-native-feature-flags branch 8 times, most recently from c560e5d to e8d5067 Compare March 31, 2026 10:34
New config plugin to allow override customisation of `ReactNativeFeatureFlags` on iOS and Android.
@huntie huntie force-pushed the react-native-feature-flags branch from e8d5067 to ba61f80 Compare March 31, 2026 11:08
@huntie huntie marked this pull request as ready for review March 31, 2026 11:21
@huntie huntie requested a review from EvanBacon as a code owner March 31, 2026 11:22
@huntie huntie closed this Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant