feat!: rewrite as a New Architecture turbo module (v3) - #71
Merged
Conversation
BREAKING CHANGE: requires React Native 0.76 or newer with the New Architecture.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
v3 is a full rewrite of the library as a New Architecture TurboModule. The Java module is replaced by Kotlin built on
WindowInsetsControllerCompat, the public API is redesigned around a smaller and more consistent surface, and iOS gains real support instead of being a stub.Why now: v2 was written against the legacy bridge and the pre-
WindowInsetsControllerflag APIs. Those flags are deprecated, Android 15 enforces edge-to-edge, and the module could settle the same promise twice — none of which could be fixed without breaking the API.API
hide·show·setImmersive·setBarStyle·setBarColor·getBarColor·setDividerColor·setContrastEnforced·setEdgeToEdge·isEdgeToEdgeEnabled·getNavigationModeiOS-only:
setHomeIndicatorAutoHidden·setSystemGesturesDeferredEvery v2 name still works as a deprecated alias with a one-time
__DEV__warning, and will be removed in v4.lowProfileis gone (the platform behavior it wrapped no longer exists) andgetBarColornow always resolves{ status, navigation }. The README has a migration table.iOS
Previously the package shipped no iOS code. It now controls the two things iOS actually exposes — the home indicator and the bottom-edge system gesture — through isa-swizzling on the window's view-controller chain, so no
AppDelegateor subclass setup is required. These are two separate methods on purpose: UIKit ignores gesture deferral while the indicator is auto-hidden, so a single combined API could not express both.Issues addressed
hide()Modal(React Native limitation; documented in the FAQ)translucentoptionAlso in this change
Example app rebuilt around the new API, demo GIFs re-recorded, README rewritten with per-method platform notes and links to the Android/Apple docs, plus
SECURITY.md, a PR template and Dependabot config.Test plan
yarn lint,yarn typecheckandyarn test(44 tests, 2 suites) all pass. Beyond that, the release build of the example app was driven end to end on emulators and a simulator:hide/showtranslucent: trueisEdgeToEdgeEnabledgetNavigationModeThe three different color outcomes are the documented Android 15+ behavior, not regressions.
iOS 26.5, iPhone 17 Pro. UIKit state read back with lldb:
setHomeIndicatorAutoHidden(true)→ root view controller becomesUIViewController_RNSystemNavigationBar,prefersHomeIndicatorAutoHidden = YES;(false)→NOsetSystemGesturesDeferred(true)→preferredScreenEdgesDeferringSystemGestures = 15(UIRectEdgeAll);(false)→0getBarColor→#00000000,isEdgeToEdgeEnabled→true,getNavigationMode→gestureNo JS or native errors in logcat or the iOS unified log on any platform.
Checklist
yarn lintandyarn typecheckpassyarn testpasses