Repository navigation
feat(web): implement Images - #4387
Merged
Merged
Conversation
Adds named images from the images prop (required assets, uris and ImageEntry objects with sdf, scale, stretchX/stretchY and content) with map.addImage, re-adds them after style reloads, and reports onImageMissing via styleimagemissing. nativeAssetImages and Image children stay unsupported on web.
This branch was previously deployed
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
This implements
Imagesfor the web build. Images from theimagesprop are loaded withmap.loadImageand added withmap.addImage. Entries can be required assets, uris, orImageEntryobjects withsdf,scale,stretchX/stretchYandcontent.scaleand stretch values follow the iOS conversion. The component re-adds its images after a style reload, removes them on unmount, and firesonImageMissingfromstyleimagemissingfor names it doesn't own.nativeAssetImagesand<Image>children still warn as unsupported on web.Checklist
CONTRIBUTING.mdyarn generatein the root folder/exampleapp./example)Screenshot OR Video
I checked these on web only, from an
expo export -p webbuild:exampleandairport-15render, andpin/pin3arrive throughonImageMissing.pin-rnstays missing because it needs<Image>.I also switched styles back and forth, and the icons stayed. Native code is unchanged.