Support headers [crossOrigin and referralPolicy] in Image without src and srcSet and only remote source.uri #14537
Labels
Area: Image
enhancement
Workstream: Component Parity
Close the parity gap between RNW and RN for core RN components and their supporting APIs.
Milestone
facebook/react-native#50799
facebook/react-native#50778
Problem Description
Implement the crossOrigin property for Image in RNW Fabric when only source.uri is passed and not src/ srcSet.
For reference, check the public API documentation: https://reactnative.dev/docs/image#crossorigin
Implement the referrerPolicy property for Image in RNW Fabric when only source.uri is passed and not src/ srcSet.
For reference, check the public API documentation: https://reactnative.dev/docs/image#referrerpolicy
Also refer docs for source, src, srcSet
https://reactnative.dev/docs/image#source
https://reactnative.dev/docs/image#src
https://reactnative.dev/docs/image#srcset
It's not mentioned in the doc that when src / srcSet is missing then crossOrigin / referralPolicy would be ignored when source uri is a remote URL that is passed.
Currently these were ignored if src / srcSet was not passed and not added to sources headers.
This change adds headers support even without passing src / srcSet and only sources uri that consists of remote URL.
crossOrigin and referrerPolicy are passed as source.headers here:
Steps To Reproduce
Expected Results
No response
CLI version
npx @react-native-community/cli -v
Environment
npx @react-native-community/cli info
Community Modules
No response
Target Platform Version
None
Target Device(s)
No response
Visual Studio Version
None
Build Configuration
None
Snack, code example, screenshot, or link to a repository
No response
The text was updated successfully, but these errors were encountered: