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: https://github.com/facebook/react-native/pull/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
This commit is contained in:
Parsa Nasirimehr 2024-11-18 04:17:39 -08:00 committed by Facebook GitHub Bot
parent e021e50d53
commit 4dd60acb7d

View File

@ -1227,7 +1227,7 @@ RCT_EXPORT_METHOD(prefetchImage
RCT_EXPORT_METHOD(prefetchImageWithMetadata
: (NSString *)uri queryRootName
: (NSString *)queryRootName rootTag
: (nullable NSString *)queryRootName rootTag
: (double)rootTag resolve
: (RCTPromiseResolveBlock)resolve reject
: (RCTPromiseRejectBlock)reject)