mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-07 08:45:00 +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() {
|
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
|
||||||
|
|||||||
@@ -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
@@ -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
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user