-
Notifications
You must be signed in to change notification settings - Fork 0
[pull] main from expo:main #540
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
#42649) # Why Removed incorrect `@platform` annotations from `Stack.*` components. Additionally added a short section to CLAUDE.md about docs. # How <!-- How did you build this feature or fix this bug and why? --> # Test Plan <!-- Please describe how you tested this change and how a reviewer could reproduce your test, especially if this PR does not include automated tests! If possible, please also provide terminal output and/or screenshots demonstrating your test/reproduction. --> # Checklist <!-- Please check the appropriate items below if they apply to your diff. --> - [ ] I added a `changelog.md` entry and rebuilt the package sources according to [this short guide](https://github.com/expo/expo/blob/main/CONTRIBUTING.md#-before-submitting) - [ ] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin). - [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) --------- Co-authored-by: Aman Mittal <amandeepmittal@live.com>
# Why
When using custom image icons in toolbar items, tabs, and menus,
developers need control over how iOS renders the image. By default, iOS
uses `.alwaysOriginal` rendering which preserves the original colors,
but when applying a `tintColor`, the icon should use `.alwaysTemplate`
rendering to respect the tint. Previously, this behavior was hardcoded
and developers couldn't override it.
**After**
```tsx
<Stack.Toolbar.Button image={image2} />
<Stack.Toolbar.Button image={image2} tintColor="red" />
<Stack.Toolbar.Button image={image2} iconRenderingMode="template" tintColor="green" />
<Stack.Toolbar.Button image={image2} iconRenderingMode="original" tintColor="orange" />
<Stack.Toolbar.Button image={image2} iconRenderingMode="template" />
<Stack.Toolbar.Button image={image2} iconRenderingMode="original" />
```
<img width="1108" height="305" alt="image"
src="https://github.com/user-attachments/assets/7f04476b-f1dc-4545-9383-45729ad2ff15"
/>
# How
Added `iconRenderingMode` prop to toolbar items, menu actions, and tab
bar icons across expo-router. The prop accepts `'template'` or
`'original'` values:
- **Smart defaults**: When `tintColor` is set, defaults to `'template'`
(icon respects tint color). Without `tintColor`, defaults to
`'original'` (preserves icon colors).
- **Explicit override**: Developers can explicitly set
`iconRenderingMode` to override the default behavior.
Components updated:
- `Stack.Toolbar.Button` and `Stack.Toolbar.Menu` (bottom toolbar)
- `Stack.Toolbar.Menu.Action` (menu actions)
- Header bar button items (left/right placement)
- Native tab bar icons
# Test Plan
1. Unit tests
2. Manual testing
# Checklist
<!--
Please check the appropriate items below if they apply to your diff.
-->
- [ ] I added a `changelog.md` entry and rebuilt the package sources
according to [this short
guide](https://github.com/expo/expo/blob/main/CONTRIBUTING.md#-before-submitting)
- [ ] This diff will work correctly for `npx expo prebuild` & EAS Build
(eg: updated a module plugin).
- [ ] Conforms with the [Documentation Writing Style
Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md)
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )