docs: add header button flash workaround for native tabs#14
Open
brentvatne wants to merge 1 commit into
Open
Conversation
Document the fix for header buttons flashing on mount when using unstable_headerLeftItems/unstable_headerRightItems with NativeTabs. The workaround uses type: 'custom' with hidesSharedBackground: true and a custom styled wrapper. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
EvanBacon
reviewed
Jan 25, 2026
| 2. **Headers missing**: Nest a Stack inside each tab group | ||
| 3. **Trigger name mismatch**: Ensure `name` matches exact route name including parentheses | ||
| 4. **Badge not visible**: Badge must be a child of Trigger, not a prop | ||
| 5. **Header button flash**: When using `unstable_headerLeftItems`/`unstable_headerRightItems`, buttons may flash on mount. Fix by using `type: 'custom'` with `hidesSharedBackground: true` and a custom styled wrapper: |
Contributor
There was a problem hiding this comment.
The preferred API for header buttons is:
<Stack.Toolbar placement="left">
<Stack.Toolbar.Button icon="gear" onPress={() => router.push('/settings')} hidesSharedBackground/>
</Stack.Toolbar>This uses the native UIBarButtonItem which doesn't flicker. It also doesn't support Android or web yet :[
Member
Author
There was a problem hiding this comment.
hm iirc this didn't work for me when i tried, can again later
Contributor
There was a problem hiding this comment.
If you want to use custom views something like this should work
<Stack.Toolbar placement="left">
<Stack.Toolbar.View hidesSharedBackground>
<Pressable
style={{ width: 24, height: 24 }}
onPress={() => router.push("/settings")}
>
<SymbolView name="gear" />
</Pressable>
</Stack.Toolbar.View>
</Stack.Toolbar>However I think that the proper solution here would be wrapping the app with <ThemeProvider
I added a PR which covers this and other common issues - #16
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
unstable_headerLeftItems/unstable_headerRightItemswith NativeTabstype: 'custom'withhidesSharedBackground: trueand a custom styled wrapper