Enable iOS asset catalog for image assets#247
Open
janicduplessis wants to merge 1 commit into
Open
Conversation
janicduplessis
marked this pull request as ready for review
July 23, 2026 13:08
Member
Thanks for mentioning. cc @cipolleschi as this is a iOS change. |
Contributor
|
this is an additive change it is not mandatory to adopt |
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:
Opt new apps into the iOS asset catalog for packager image assets, added in react/react-native#30129 (landed in main as
26769a00b23).When the
RCTUseAssetCatalogkey is set inInfo.plist,react-native-xcode.shcompiles bundled images into anRNAssets.bundleasset catalog (viaactool) and the native image loader resolves them by name, instead of copying each image and every@2x/@3xvariant as a loose file next to the JS bundle. The catalog lets the OS pick and load only the scale a device needs, which reduces app size and makes image lookups a single named catalog resolution.The same key gates both the build script and the runtime loader, so bundling and lookup can't disagree about where assets live. Apps that don't set it are unaffected. The template tracks
react-native: nightly, which includes the feature, so no version bump is needed here.Changelog:
[IOS] [ADDED] - Enable the iOS asset catalog (
RCTUseAssetCatalog) for image assets in new appsTest Plan:
RNAssets.bundleis produced in the app and itsAssets.carcontains the app's image assets.<Image source={require('./img.png')} />renders at the correct scale on devices of different scales.