Skip to content

docs: add header button flash workaround for native tabs#14

Open
brentvatne wants to merge 1 commit into
mainfrom
docs/header-button-flash-workaround
Open

docs: add header button flash workaround for native tabs#14
brentvatne wants to merge 1 commit into
mainfrom
docs/header-button-flash-workaround

Conversation

@brentvatne

Copy link
Copy Markdown
Member

Summary

  • 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

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>
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:

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 :[

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hm iirc this didn't work for me when i tried, can again later

@Ubax Ubax Jan 28, 2026

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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.

3 participants