mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-01 14:15:03 +00:00
fix: [types] allow Image "href" & "xlinkHref" to be strings (#1896)
Allow 'string' type for href and xlinkHref props in Image component. Logic in the component allows passing 'string' values to the Image.resolveAssetSource by checking for its type, so it would be nice to reflect it on the properties types as well.
This commit is contained in:
@@ -28,8 +28,8 @@ export interface ImageProps
|
||||
y?: NumberProp;
|
||||
width?: NumberProp;
|
||||
height?: NumberProp;
|
||||
xlinkHref?: RNImageProps['source'];
|
||||
href?: RNImageProps['source'];
|
||||
xlinkHref?: RNImageProps['source'] | string;
|
||||
href?: RNImageProps['source'] | string;
|
||||
preserveAspectRatio?: string;
|
||||
opacity?: NumberProp;
|
||||
clipPath?: string;
|
||||
|
||||
+2
-2
@@ -252,8 +252,8 @@ export type ImageProps = {
|
||||
y?: NumberProp,
|
||||
width?: NumberProp,
|
||||
height?: NumberProp,
|
||||
xlinkHref?: $PropertyType<ReactNative.ImageProps, "source">,
|
||||
href?: $PropertyType<ReactNative.ImageProps, "source">,
|
||||
xlinkHref?: $PropertyType<ReactNative.ImageProps, "source"> | string,
|
||||
href?: $PropertyType<ReactNative.ImageProps, "source"> | string,
|
||||
preserveAspectRatio?: string,
|
||||
opacity?: NumberProp,
|
||||
clipPath?: string,
|
||||
|
||||
Reference in New Issue
Block a user