mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-01 22:25:12 +00:00
Accept xlinkHref as fallback to href, Fixes #500
This commit is contained in:
+1
-1
@@ -19,7 +19,7 @@ export default class SvgImage extends Shape {
|
||||
|
||||
render() {
|
||||
const { props } = this;
|
||||
const { preserveAspectRatio, x, y, width, height, href } = props;
|
||||
const { preserveAspectRatio, x, y, width, height, xlinkHref, href = xlinkHref } = props;
|
||||
const modes = preserveAspectRatio.trim().split(spacesRegExp);
|
||||
return (
|
||||
<RNSVGImage
|
||||
|
||||
@@ -25,7 +25,8 @@ export default class TextPath extends Shape {
|
||||
render() {
|
||||
const {
|
||||
children,
|
||||
href,
|
||||
xlinkHref,
|
||||
href = xlinkHref,
|
||||
startOffset,
|
||||
method,
|
||||
spacing,
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ export default class Use extends Shape {
|
||||
|
||||
render() {
|
||||
const { props } = this;
|
||||
const { children, x, y, width, height, href } = props;
|
||||
const { children, x, y, width, height, xlinkHref, href = xlinkHref } = props;
|
||||
|
||||
// match "url(#pattern)"
|
||||
const matched = href.match(idPattern);
|
||||
|
||||
Vendored
+3
@@ -192,6 +192,7 @@ export interface ImageProps extends ResponderProps, TouchableProps {
|
||||
y?: NumberProp,
|
||||
width?: NumberProp,
|
||||
height?: NumberProp,
|
||||
xlinkHref?: ReactNative.ImageProperties['source'],
|
||||
href: ReactNative.ImageProperties['source'],
|
||||
preserveAspectRatio?: string,
|
||||
opacity?: NumberProp,
|
||||
@@ -324,6 +325,7 @@ export interface TextProps extends TextSpecificProps {
|
||||
export const Text: React.ComponentClass<TextProps>;
|
||||
|
||||
export interface TextPathProps extends TextSpecificProps {
|
||||
xlinkHref?: string,
|
||||
href: string,
|
||||
startOffset?: NumberProp,
|
||||
method?: TextPathMethod,
|
||||
@@ -333,6 +335,7 @@ export interface TextPathProps extends TextSpecificProps {
|
||||
export const TextPath: React.ComponentClass<TextPathProps>;
|
||||
|
||||
export interface UseProps extends CommonPathProps {
|
||||
xlinkHref?: string,
|
||||
href: string,
|
||||
width?: string,
|
||||
height?: string,
|
||||
|
||||
Reference in New Issue
Block a user