Accept xlinkHref as fallback to href, Fixes #500

This commit is contained in:
Mikael Sand
2019-01-23 19:04:01 +02:00
parent a620d31d6d
commit bc14b90773
4 changed files with 7 additions and 3 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ export default class SvgImage extends Shape {
render() { render() {
const { props } = this; 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); const modes = preserveAspectRatio.trim().split(spacesRegExp);
return ( return (
<RNSVGImage <RNSVGImage
+2 -1
View File
@@ -25,7 +25,8 @@ export default class TextPath extends Shape {
render() { render() {
const { const {
children, children,
href, xlinkHref,
href = xlinkHref,
startOffset, startOffset,
method, method,
spacing, spacing,
+1 -1
View File
@@ -16,7 +16,7 @@ export default class Use extends Shape {
render() { render() {
const { props } = this; const { props } = this;
const { children, x, y, width, height, href } = props; const { children, x, y, width, height, xlinkHref, href = xlinkHref } = props;
// match "url(#pattern)" // match "url(#pattern)"
const matched = href.match(idPattern); const matched = href.match(idPattern);
Vendored
+3
View File
@@ -192,6 +192,7 @@ export interface ImageProps extends ResponderProps, TouchableProps {
y?: NumberProp, y?: NumberProp,
width?: NumberProp, width?: NumberProp,
height?: NumberProp, height?: NumberProp,
xlinkHref?: ReactNative.ImageProperties['source'],
href: ReactNative.ImageProperties['source'], href: ReactNative.ImageProperties['source'],
preserveAspectRatio?: string, preserveAspectRatio?: string,
opacity?: NumberProp, opacity?: NumberProp,
@@ -324,6 +325,7 @@ export interface TextProps extends TextSpecificProps {
export const Text: React.ComponentClass<TextProps>; export const Text: React.ComponentClass<TextProps>;
export interface TextPathProps extends TextSpecificProps { export interface TextPathProps extends TextSpecificProps {
xlinkHref?: string,
href: string, href: string,
startOffset?: NumberProp, startOffset?: NumberProp,
method?: TextPathMethod, method?: TextPathMethod,
@@ -333,6 +335,7 @@ export interface TextPathProps extends TextSpecificProps {
export const TextPath: React.ComponentClass<TextPathProps>; export const TextPath: React.ComponentClass<TextPathProps>;
export interface UseProps extends CommonPathProps { export interface UseProps extends CommonPathProps {
xlinkHref?: string,
href: string, href: string,
width?: string, width?: string,
height?: string, height?: string,