feat(tabs): add iOS search toolbar items#4131
Draft
marcodejongh wants to merge 3 commits into
Draft
Conversation
3 tasks
f99f109 to
51656a4
Compare
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.
Description
Adds the native
react-native-screensprimitive needed to render UIKit toolbar items next to the integrated iOS 26 search control in native tabs.The motivation is to support downstream APIs, including Expo Router native tabs, without replacing the native tab bar or search control with a custom JavaScript bar. This keeps UIKit rendering, native search expansion, toolbar minimization, and accessibility semantics intact.
Companion Expo Router PR: expo/expo#46617.
Changes
ios.toolbarItemsto native tabs screen props, reusing the existing header bar button item shape.onPressToolbarItemevent and dispatches the matching itemonPresshandler from JS.navigationItem.searchBarPlacementBarButtonItemwhen the selected iOS tab usessystemItem: 'search'and search toolbar integration is available.Before & after - visual documentation
The screenshot below was captured from
FabricExamplerunning on an iOS 26.5 simulator. It shows the native integrated search field with a trailing SF Symbol toolbar item rendered by UIKit.Test plan
Tested locally:
yarn check-typesxcodebuild -quiet -workspace FabricExample/ios/FabricExample.xcworkspace -scheme FabricExample -configuration Debug -sdk iphonesimulator -destination 'generic/platform=iOS Simulator' -derivedDataPath /private/tmp/rns-fabric-example-derived-data CODE_SIGNING_ALLOWED=NO buildxcodebuild -quiet -workspace FabricExample/ios/FabricExample.xcworkspace -scheme FabricExample -configuration Debug -sdk iphonesimulator -destination 'id=BB8A37F1-DDBE-4344-9B98-6526C6B17566' -derivedDataPath /private/tmp/rns-fabric-example-final-derived-data CODE_SIGNING_ALLOWED=NO buildFabricExampleon iOS 26.5 simulator and captured/private/tmp/rns-search-toolbar-leading-reserve-helper.png.git diff --checkAlso tried
yarn test:unit --no-watchman; it fails before reaching relevant tests becauseTVOSExample/__tests__/App.test.tsxcannot resolvereact-native-screensin the current local setup.Minimal usage example:
Checklist