Skip to content

Commit 4dd60ac

Browse files
TheRogue76facebook-github-bot
authored andcommitted
fix(iOS): unify prefetchImageWithMetadata's signature in JS and ObjC land (#47532)
Summary: in `prefetchImageWithMetadata`'s implementation in ObjC, the method's `queryRootName` is treated as being nullable. The image spec for it in JS (and the Codegened ObjC header that gets built on top of it) treat the field as not nullable. This change makes the field nullable in the spec to match up what we have in the implementation. I also noticed that the method is not defined in the [Image props](https://reactnative.dev/docs/image) on the RN website, so perhaps we should add this there as well. bypass-github-export-checks ## Changelog: [IOS] [CHANGED] - make `prefetchImageWithMetadata`'s `queryRootName` nullable in the spec Pull Request resolved: #47532 Test Plan: yarn test: <img width="1576" alt="Screenshot 2024-11-09 at 00 36 30" src="https://github.com/user-attachments/assets/4162ff79-1388-4f6f-9576-256fd9011fcf"> It has no iOS specific tests, so nothing to run on that side Reviewed By: javache Differential Revision: D65761208 Pulled By: cipolleschi fbshipit-source-id: d050950486e9f804b65dab047d93761a610a71e7
1 parent e021e50 commit 4dd60ac

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

packages/react-native/Libraries/Image/RCTImageLoader.mm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1227,7 +1227,7 @@ - (void)cancelRequest:(id)requestToken
12271227

12281228
RCT_EXPORT_METHOD(prefetchImageWithMetadata
12291229
: (NSString *)uri queryRootName
1230-
: (NSString *)queryRootName rootTag
1230+
: (nullable NSString *)queryRootName rootTag
12311231
: (double)rootTag resolve
12321232
: (RCTPromiseResolveBlock)resolve reject
12331233
: (RCTPromiseRejectBlock)reject)

0 commit comments

Comments
 (0)