mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-09 09:27:20 +00:00
Use singleQuote
This commit is contained in:
+6
-6
@@ -1,10 +1,10 @@
|
||||
import React from "react";
|
||||
import { requireNativeComponent } from "react-native";
|
||||
import extractProps, { propsAndStyles } from "../lib/extract/extractProps";
|
||||
import Shape from "./Shape";
|
||||
import React from 'react';
|
||||
import { requireNativeComponent } from 'react-native';
|
||||
import extractProps, { propsAndStyles } from '../lib/extract/extractProps';
|
||||
import Shape from './Shape';
|
||||
|
||||
export default class Circle extends Shape {
|
||||
static displayName = "Circle";
|
||||
static displayName = 'Circle';
|
||||
|
||||
static defaultProps = {
|
||||
cx: 0,
|
||||
@@ -27,4 +27,4 @@ export default class Circle extends Shape {
|
||||
}
|
||||
}
|
||||
|
||||
const RNSVGCircle = requireNativeComponent("RNSVGCircle");
|
||||
const RNSVGCircle = requireNativeComponent('RNSVGCircle');
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
import React from "react";
|
||||
import { requireNativeComponent } from "react-native";
|
||||
import extractClipPath from "../lib/extract/extractClipPath";
|
||||
import Shape from "./Shape";
|
||||
import React from 'react';
|
||||
import { requireNativeComponent } from 'react-native';
|
||||
import extractClipPath from '../lib/extract/extractClipPath';
|
||||
import Shape from './Shape';
|
||||
|
||||
export default class ClipPath extends Shape {
|
||||
static displayName = "ClipPath";
|
||||
static displayName = 'ClipPath';
|
||||
|
||||
render() {
|
||||
const { id, children } = this.props;
|
||||
@@ -20,4 +20,4 @@ export default class ClipPath extends Shape {
|
||||
}
|
||||
}
|
||||
|
||||
const RNSVGClipPath = requireNativeComponent("RNSVGClipPath");
|
||||
const RNSVGClipPath = requireNativeComponent('RNSVGClipPath');
|
||||
|
||||
+4
-4
@@ -1,12 +1,12 @@
|
||||
import React, { Component } from "react";
|
||||
import { requireNativeComponent } from "react-native";
|
||||
import React, { Component } from 'react';
|
||||
import { requireNativeComponent } from 'react-native';
|
||||
|
||||
export default class Defs extends Component {
|
||||
static displayName = "Defs";
|
||||
static displayName = 'Defs';
|
||||
|
||||
render() {
|
||||
return <RNSVGDefs>{this.props.children}</RNSVGDefs>;
|
||||
}
|
||||
}
|
||||
|
||||
const RNSVGDefs = requireNativeComponent("RNSVGDefs");
|
||||
const RNSVGDefs = requireNativeComponent('RNSVGDefs');
|
||||
|
||||
+6
-6
@@ -1,10 +1,10 @@
|
||||
import React from "react";
|
||||
import { requireNativeComponent } from "react-native";
|
||||
import extractProps, { propsAndStyles } from "../lib/extract/extractProps";
|
||||
import Shape from "./Shape";
|
||||
import React from 'react';
|
||||
import { requireNativeComponent } from 'react-native';
|
||||
import extractProps, { propsAndStyles } from '../lib/extract/extractProps';
|
||||
import Shape from './Shape';
|
||||
|
||||
export default class Ellipse extends Shape {
|
||||
static displayName = "Ellipse";
|
||||
static displayName = 'Ellipse';
|
||||
|
||||
static defaultProps = {
|
||||
cx: 0,
|
||||
@@ -29,4 +29,4 @@ export default class Ellipse extends Shape {
|
||||
}
|
||||
}
|
||||
|
||||
const RNSVGEllipse = requireNativeComponent("RNSVGEllipse");
|
||||
const RNSVGEllipse = requireNativeComponent('RNSVGEllipse');
|
||||
|
||||
+8
-8
@@ -1,12 +1,12 @@
|
||||
import React from "react";
|
||||
import { requireNativeComponent } from "react-native";
|
||||
import extractProps, { propsAndStyles } from "../lib/extract/extractProps";
|
||||
import { extractFont } from "../lib/extract/extractText";
|
||||
import extractTransform from "../lib/extract/extractTransform";
|
||||
import Shape from "./Shape";
|
||||
import React from 'react';
|
||||
import { requireNativeComponent } from 'react-native';
|
||||
import extractProps, { propsAndStyles } from '../lib/extract/extractProps';
|
||||
import { extractFont } from '../lib/extract/extractText';
|
||||
import extractTransform from '../lib/extract/extractTransform';
|
||||
import Shape from './Shape';
|
||||
|
||||
export default class G extends Shape {
|
||||
static displayName = "G";
|
||||
static displayName = 'G';
|
||||
|
||||
setNativeProps = props => {
|
||||
const matrix = !props.matrix && extractTransform(props);
|
||||
@@ -31,4 +31,4 @@ export default class G extends Shape {
|
||||
}
|
||||
}
|
||||
|
||||
const RNSVGGroup = requireNativeComponent("RNSVGGroup");
|
||||
const RNSVGGroup = requireNativeComponent('RNSVGGroup');
|
||||
|
||||
+9
-9
@@ -1,20 +1,20 @@
|
||||
import React from "react";
|
||||
import { Image, requireNativeComponent } from "react-native";
|
||||
import { meetOrSliceTypes, alignEnum } from "../lib/extract/extractViewBox";
|
||||
import extractProps, { propsAndStyles } from "../lib/extract/extractProps";
|
||||
import Shape from "./Shape";
|
||||
import React from 'react';
|
||||
import { Image, requireNativeComponent } from 'react-native';
|
||||
import { meetOrSliceTypes, alignEnum } from '../lib/extract/extractViewBox';
|
||||
import extractProps, { propsAndStyles } from '../lib/extract/extractProps';
|
||||
import Shape from './Shape';
|
||||
|
||||
const spacesRegExp = /\s+/;
|
||||
|
||||
export default class SvgImage extends Shape {
|
||||
static displayName = "Image";
|
||||
static displayName = 'Image';
|
||||
|
||||
static defaultProps = {
|
||||
x: 0,
|
||||
y: 0,
|
||||
width: 0,
|
||||
height: 0,
|
||||
preserveAspectRatio: "xMidYMid meet",
|
||||
preserveAspectRatio: 'xMidYMid meet',
|
||||
};
|
||||
|
||||
render() {
|
||||
@@ -38,11 +38,11 @@ export default class SvgImage extends Shape {
|
||||
width={width}
|
||||
height={height}
|
||||
meetOrSlice={meetOrSliceTypes[modes[1]] || 0}
|
||||
align={alignEnum[modes[0]] || "xMidYMid"}
|
||||
align={alignEnum[modes[0]] || 'xMidYMid'}
|
||||
src={Image.resolveAssetSource(href)}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const RNSVGImage = requireNativeComponent("RNSVGImage");
|
||||
const RNSVGImage = requireNativeComponent('RNSVGImage');
|
||||
|
||||
+6
-6
@@ -1,10 +1,10 @@
|
||||
import React from "react";
|
||||
import { requireNativeComponent } from "react-native";
|
||||
import extractProps, { propsAndStyles } from "../lib/extract/extractProps";
|
||||
import Shape from "./Shape";
|
||||
import React from 'react';
|
||||
import { requireNativeComponent } from 'react-native';
|
||||
import extractProps, { propsAndStyles } from '../lib/extract/extractProps';
|
||||
import Shape from './Shape';
|
||||
|
||||
export default class Line extends Shape {
|
||||
static displayName = "Line";
|
||||
static displayName = 'Line';
|
||||
|
||||
static defaultProps = {
|
||||
x1: 0,
|
||||
@@ -29,4 +29,4 @@ export default class Line extends Shape {
|
||||
}
|
||||
}
|
||||
|
||||
const RNSVGLine = requireNativeComponent("RNSVGLine");
|
||||
const RNSVGLine = requireNativeComponent('RNSVGLine');
|
||||
|
||||
+10
-10
@@ -1,16 +1,16 @@
|
||||
import React from "react";
|
||||
import { requireNativeComponent } from "react-native";
|
||||
import extractGradient from "../lib/extract/extractGradient";
|
||||
import Shape from "./Shape";
|
||||
import React from 'react';
|
||||
import { requireNativeComponent } from 'react-native';
|
||||
import extractGradient from '../lib/extract/extractGradient';
|
||||
import Shape from './Shape';
|
||||
|
||||
export default class LinearGradient extends Shape {
|
||||
static displayName = "LinearGradient";
|
||||
static displayName = 'LinearGradient';
|
||||
|
||||
static defaultProps = {
|
||||
x1: "0%",
|
||||
y1: "0%",
|
||||
x2: "100%",
|
||||
y2: "0%",
|
||||
x1: '0%',
|
||||
y1: '0%',
|
||||
x2: '100%',
|
||||
y2: '0%',
|
||||
};
|
||||
|
||||
render() {
|
||||
@@ -29,4 +29,4 @@ export default class LinearGradient extends Shape {
|
||||
}
|
||||
}
|
||||
|
||||
const RNSVGLinearGradient = requireNativeComponent("RNSVGLinearGradient");
|
||||
const RNSVGLinearGradient = requireNativeComponent('RNSVGLinearGradient');
|
||||
|
||||
+12
-12
@@ -1,18 +1,18 @@
|
||||
import React from "react";
|
||||
import { requireNativeComponent } from "react-native";
|
||||
import extractTransform from "../lib/extract/extractTransform";
|
||||
import extractProps, { propsAndStyles } from "../lib/extract/extractProps";
|
||||
import units from "../lib/units";
|
||||
import Shape from "./Shape";
|
||||
import React from 'react';
|
||||
import { requireNativeComponent } from 'react-native';
|
||||
import extractTransform from '../lib/extract/extractTransform';
|
||||
import extractProps, { propsAndStyles } from '../lib/extract/extractProps';
|
||||
import units from '../lib/units';
|
||||
import Shape from './Shape';
|
||||
|
||||
export default class Mask extends Shape {
|
||||
static displayName = "Mask";
|
||||
static displayName = 'Mask';
|
||||
|
||||
static defaultProps = {
|
||||
x: "0%",
|
||||
y: "0%",
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
x: '0%',
|
||||
y: '0%',
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
};
|
||||
|
||||
render() {
|
||||
@@ -48,4 +48,4 @@ export default class Mask extends Shape {
|
||||
}
|
||||
}
|
||||
|
||||
const RNSVGMask = requireNativeComponent("RNSVGMask");
|
||||
const RNSVGMask = requireNativeComponent('RNSVGMask');
|
||||
|
||||
+6
-6
@@ -1,10 +1,10 @@
|
||||
import React from "react";
|
||||
import { requireNativeComponent } from "react-native";
|
||||
import extractProps, { propsAndStyles } from "../lib/extract/extractProps";
|
||||
import Shape from "./Shape";
|
||||
import React from 'react';
|
||||
import { requireNativeComponent } from 'react-native';
|
||||
import extractProps, { propsAndStyles } from '../lib/extract/extractProps';
|
||||
import Shape from './Shape';
|
||||
|
||||
export default class Path extends Shape {
|
||||
static displayName = "Path";
|
||||
static displayName = 'Path';
|
||||
|
||||
render() {
|
||||
const { props } = this;
|
||||
@@ -18,4 +18,4 @@ export default class Path extends Shape {
|
||||
}
|
||||
}
|
||||
|
||||
const RNSVGPath = requireNativeComponent("RNSVGPath");
|
||||
const RNSVGPath = requireNativeComponent('RNSVGPath');
|
||||
|
||||
+12
-12
@@ -1,18 +1,18 @@
|
||||
import React from "react";
|
||||
import { requireNativeComponent } from "react-native";
|
||||
import extractTransform from "../lib/extract/extractTransform";
|
||||
import extractViewBox from "../lib/extract/extractViewBox";
|
||||
import units from "../lib/units";
|
||||
import Shape from "./Shape";
|
||||
import React from 'react';
|
||||
import { requireNativeComponent } from 'react-native';
|
||||
import extractTransform from '../lib/extract/extractTransform';
|
||||
import extractViewBox from '../lib/extract/extractViewBox';
|
||||
import units from '../lib/units';
|
||||
import Shape from './Shape';
|
||||
|
||||
export default class Pattern extends Shape {
|
||||
static displayName = "Pattern";
|
||||
static displayName = 'Pattern';
|
||||
|
||||
static defaultProps = {
|
||||
x: "0%",
|
||||
y: "0%",
|
||||
width: "100%",
|
||||
height: "100%",
|
||||
x: '0%',
|
||||
y: '0%',
|
||||
width: '100%',
|
||||
height: '100%',
|
||||
};
|
||||
|
||||
render() {
|
||||
@@ -54,4 +54,4 @@ export default class Pattern extends Shape {
|
||||
}
|
||||
}
|
||||
|
||||
const RNSVGPattern = requireNativeComponent("RNSVGPattern");
|
||||
const RNSVGPattern = requireNativeComponent('RNSVGPattern');
|
||||
|
||||
+6
-6
@@ -1,13 +1,13 @@
|
||||
import React from "react";
|
||||
import Path from "./Path";
|
||||
import Shape from "./Shape";
|
||||
import extractPolyPoints from "../lib/extract/extractPolyPoints";
|
||||
import React from 'react';
|
||||
import Path from './Path';
|
||||
import Shape from './Shape';
|
||||
import extractPolyPoints from '../lib/extract/extractPolyPoints';
|
||||
|
||||
export default class Polygon extends Shape {
|
||||
static displayName = "Polygon";
|
||||
static displayName = 'Polygon';
|
||||
|
||||
static defaultProps = {
|
||||
points: "",
|
||||
points: '',
|
||||
};
|
||||
|
||||
setNativeProps = props => {
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import React from "react";
|
||||
import Path from "./Path";
|
||||
import Shape from "./Shape";
|
||||
import extractPolyPoints from "../lib/extract/extractPolyPoints";
|
||||
import React from 'react';
|
||||
import Path from './Path';
|
||||
import Shape from './Shape';
|
||||
import extractPolyPoints from '../lib/extract/extractPolyPoints';
|
||||
|
||||
export default class Polyline extends Shape {
|
||||
static displayName = "Polyline";
|
||||
static displayName = 'Polyline';
|
||||
|
||||
static defaultProps = {
|
||||
points: "",
|
||||
points: '',
|
||||
};
|
||||
|
||||
setNativeProps = props => {
|
||||
|
||||
+11
-11
@@ -1,17 +1,17 @@
|
||||
import React from "react";
|
||||
import { requireNativeComponent } from "react-native";
|
||||
import extractGradient from "../lib/extract/extractGradient";
|
||||
import Shape from "./Shape";
|
||||
import React from 'react';
|
||||
import { requireNativeComponent } from 'react-native';
|
||||
import extractGradient from '../lib/extract/extractGradient';
|
||||
import Shape from './Shape';
|
||||
|
||||
export default class RadialGradient extends Shape {
|
||||
static displayName = "RadialGradient";
|
||||
static displayName = 'RadialGradient';
|
||||
|
||||
static defaultProps = {
|
||||
fx: "50%",
|
||||
fy: "50%",
|
||||
cx: "50%",
|
||||
cy: "50%",
|
||||
r: "50%",
|
||||
fx: '50%',
|
||||
fy: '50%',
|
||||
cx: '50%',
|
||||
cy: '50%',
|
||||
r: '50%',
|
||||
};
|
||||
|
||||
render() {
|
||||
@@ -32,4 +32,4 @@ export default class RadialGradient extends Shape {
|
||||
}
|
||||
}
|
||||
|
||||
const RNSVGRadialGradient = requireNativeComponent("RNSVGRadialGradient");
|
||||
const RNSVGRadialGradient = requireNativeComponent('RNSVGRadialGradient');
|
||||
|
||||
+6
-6
@@ -1,10 +1,10 @@
|
||||
import React from "react";
|
||||
import { requireNativeComponent } from "react-native";
|
||||
import extractProps, { propsAndStyles } from "../lib/extract/extractProps";
|
||||
import Shape from "./Shape";
|
||||
import React from 'react';
|
||||
import { requireNativeComponent } from 'react-native';
|
||||
import extractProps, { propsAndStyles } from '../lib/extract/extractProps';
|
||||
import Shape from './Shape';
|
||||
|
||||
export default class Rect extends Shape {
|
||||
static displayName = "Rect";
|
||||
static displayName = 'Rect';
|
||||
|
||||
static defaultProps = {
|
||||
x: 0,
|
||||
@@ -40,4 +40,4 @@ export default class Rect extends Shape {
|
||||
}
|
||||
}
|
||||
|
||||
const RNSVGRect = requireNativeComponent("RNSVGRect");
|
||||
const RNSVGRect = requireNativeComponent('RNSVGRect');
|
||||
|
||||
+3
-3
@@ -1,5 +1,5 @@
|
||||
import { Component } from "react";
|
||||
import SvgTouchableMixin from "../lib/SvgTouchableMixin";
|
||||
import { Component } from 'react';
|
||||
import SvgTouchableMixin from '../lib/SvgTouchableMixin';
|
||||
|
||||
const touchKeys = Object.keys(SvgTouchableMixin);
|
||||
const touchVals = touchKeys.map(key => SvgTouchableMixin[key]);
|
||||
@@ -11,7 +11,7 @@ export default class Shape extends Component {
|
||||
for (let i = 0; i < numTouchKeys; i++) {
|
||||
const key = touchKeys[i];
|
||||
const val = touchVals[i];
|
||||
if (typeof val === "function") {
|
||||
if (typeof val === 'function') {
|
||||
this[key] = val.bind(this);
|
||||
} else {
|
||||
this[key] = val;
|
||||
|
||||
+3
-3
@@ -1,10 +1,10 @@
|
||||
import { Component } from "react";
|
||||
import { Component } from 'react';
|
||||
|
||||
export default class Stop extends Component {
|
||||
static displayName = "Stop";
|
||||
static displayName = 'Stop';
|
||||
|
||||
static defaultProps = {
|
||||
stopColor: "#000",
|
||||
stopColor: '#000',
|
||||
stopOpacity: 1,
|
||||
};
|
||||
setNativeProps = () => {
|
||||
|
||||
+12
-12
@@ -1,29 +1,29 @@
|
||||
import React from "react";
|
||||
import React from 'react';
|
||||
import {
|
||||
requireNativeComponent,
|
||||
StyleSheet,
|
||||
findNodeHandle,
|
||||
NativeModules,
|
||||
} from "react-native";
|
||||
import extractResponder from "../lib/extract/extractResponder";
|
||||
import extractViewBox from "../lib/extract/extractViewBox";
|
||||
import Shape from "./Shape";
|
||||
import G from "./G";
|
||||
} from 'react-native';
|
||||
import extractResponder from '../lib/extract/extractResponder';
|
||||
import extractViewBox from '../lib/extract/extractViewBox';
|
||||
import Shape from './Shape';
|
||||
import G from './G';
|
||||
|
||||
const RNSVGSvgViewManager = NativeModules.RNSVGSvgViewManager;
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
svg: {
|
||||
backgroundColor: "transparent",
|
||||
backgroundColor: 'transparent',
|
||||
borderWidth: 0,
|
||||
},
|
||||
});
|
||||
|
||||
export default class Svg extends Shape {
|
||||
static displayName = "Svg";
|
||||
static displayName = 'Svg';
|
||||
|
||||
static defaultProps = {
|
||||
preserveAspectRatio: "xMidYMid meet",
|
||||
preserveAspectRatio: 'xMidYMid meet',
|
||||
};
|
||||
|
||||
measureInWindow = (...args) => {
|
||||
@@ -91,8 +91,8 @@ export default class Svg extends Shape {
|
||||
|
||||
const w = parseInt(width, 10);
|
||||
const h = parseInt(height, 10);
|
||||
const doNotParseWidth = isNaN(w) || width[width.length - 1] === "%";
|
||||
const doNotParseHeight = isNaN(h) || height[height.length - 1] === "%";
|
||||
const doNotParseWidth = isNaN(w) || width[width.length - 1] === '%';
|
||||
const doNotParseHeight = isNaN(h) || height[height.length - 1] === '%';
|
||||
const dimensions =
|
||||
width && height
|
||||
? {
|
||||
@@ -145,4 +145,4 @@ export default class Svg extends Shape {
|
||||
}
|
||||
}
|
||||
|
||||
const NativeSvgView = requireNativeComponent("RNSVGSvgView");
|
||||
const NativeSvgView = requireNativeComponent('RNSVGSvgView');
|
||||
|
||||
+6
-6
@@ -1,10 +1,10 @@
|
||||
import React from "react";
|
||||
import { requireNativeComponent } from "react-native";
|
||||
import extractViewBox from "../lib/extract/extractViewBox";
|
||||
import Shape from "./Shape";
|
||||
import React from 'react';
|
||||
import { requireNativeComponent } from 'react-native';
|
||||
import extractViewBox from '../lib/extract/extractViewBox';
|
||||
import Shape from './Shape';
|
||||
|
||||
export default class Symbol extends Shape {
|
||||
static displayName = "Symbol";
|
||||
static displayName = 'Symbol';
|
||||
|
||||
render() {
|
||||
const { props } = this;
|
||||
@@ -17,4 +17,4 @@ export default class Symbol extends Shape {
|
||||
}
|
||||
}
|
||||
|
||||
const RNSVGSymbol = requireNativeComponent("RNSVGSymbol");
|
||||
const RNSVGSymbol = requireNativeComponent('RNSVGSymbol');
|
||||
|
||||
+9
-9
@@ -1,13 +1,13 @@
|
||||
import React from "react";
|
||||
import { requireNativeComponent } from "react-native";
|
||||
import extractProps, { propsAndStyles } from "../lib/extract/extractProps";
|
||||
import extractTransform from "../lib/extract/extractTransform";
|
||||
import extractText, { setTSpan } from "../lib/extract/extractText";
|
||||
import { pickNotNil } from "../lib/util";
|
||||
import Shape from "./Shape";
|
||||
import React from 'react';
|
||||
import { requireNativeComponent } from 'react-native';
|
||||
import extractProps, { propsAndStyles } from '../lib/extract/extractProps';
|
||||
import extractTransform from '../lib/extract/extractTransform';
|
||||
import extractText, { setTSpan } from '../lib/extract/extractText';
|
||||
import { pickNotNil } from '../lib/util';
|
||||
import Shape from './Shape';
|
||||
|
||||
export default class TSpan extends Shape {
|
||||
static displayName = "TSpan";
|
||||
static displayName = 'TSpan';
|
||||
|
||||
setNativeProps = props => {
|
||||
const matrix = !props.matrix && extractTransform(props);
|
||||
@@ -43,4 +43,4 @@ export default class TSpan extends Shape {
|
||||
|
||||
setTSpan(TSpan);
|
||||
|
||||
const RNSVGTSpan = requireNativeComponent("RNSVGTSpan");
|
||||
const RNSVGTSpan = requireNativeComponent('RNSVGTSpan');
|
||||
|
||||
+10
-10
@@ -1,14 +1,14 @@
|
||||
import React from "react";
|
||||
import { requireNativeComponent } from "react-native";
|
||||
import extractText from "../lib/extract/extractText";
|
||||
import extractProps, { propsAndStyles } from "../lib/extract/extractProps";
|
||||
import extractTransform from "../lib/extract/extractTransform";
|
||||
import { pickNotNil } from "../lib/util";
|
||||
import Shape from "./Shape";
|
||||
import "./TSpan";
|
||||
import React from 'react';
|
||||
import { requireNativeComponent } from 'react-native';
|
||||
import extractText from '../lib/extract/extractText';
|
||||
import extractProps, { propsAndStyles } from '../lib/extract/extractProps';
|
||||
import extractTransform from '../lib/extract/extractTransform';
|
||||
import { pickNotNil } from '../lib/util';
|
||||
import Shape from './Shape';
|
||||
import './TSpan';
|
||||
|
||||
export default class Text extends Shape {
|
||||
static displayName = "Text";
|
||||
static displayName = 'Text';
|
||||
|
||||
setNativeProps = props => {
|
||||
const matrix = !props.matrix && extractTransform(props);
|
||||
@@ -42,4 +42,4 @@ export default class Text extends Shape {
|
||||
}
|
||||
}
|
||||
|
||||
const RNSVGText = requireNativeComponent("RNSVGText");
|
||||
const RNSVGText = requireNativeComponent('RNSVGText');
|
||||
|
||||
+11
-11
@@ -1,14 +1,14 @@
|
||||
import React from "react";
|
||||
import { requireNativeComponent } from "react-native";
|
||||
import extractTransform from "../lib/extract/extractTransform";
|
||||
import extractProps, { propsAndStyles } from "../lib/extract/extractProps";
|
||||
import extractText from "../lib/extract/extractText";
|
||||
import { idPattern, pickNotNil } from "../lib/util";
|
||||
import Shape from "./Shape";
|
||||
import TSpan from "./TSpan";
|
||||
import React from 'react';
|
||||
import { requireNativeComponent } from 'react-native';
|
||||
import extractTransform from '../lib/extract/extractTransform';
|
||||
import extractProps, { propsAndStyles } from '../lib/extract/extractProps';
|
||||
import extractText from '../lib/extract/extractText';
|
||||
import { idPattern, pickNotNil } from '../lib/util';
|
||||
import Shape from './Shape';
|
||||
import TSpan from './TSpan';
|
||||
|
||||
export default class TextPath extends Shape {
|
||||
static displayName = "TextPath";
|
||||
static displayName = 'TextPath';
|
||||
|
||||
setNativeProps = props => {
|
||||
const matrix = !props.matrix && extractTransform(props);
|
||||
@@ -69,7 +69,7 @@ export default class TextPath extends Shape {
|
||||
}
|
||||
|
||||
console.warn(
|
||||
'Invalid `href` prop for `TextPath` element, expected a href like `"#id"`, but got: "' +
|
||||
'Invalid `href` prop for `TextPath` element, expected a href like "#id", but got: "' +
|
||||
href +
|
||||
'"',
|
||||
);
|
||||
@@ -77,4 +77,4 @@ export default class TextPath extends Shape {
|
||||
}
|
||||
}
|
||||
|
||||
const RNSVGTextPath = requireNativeComponent("RNSVGTextPath");
|
||||
const RNSVGTextPath = requireNativeComponent('RNSVGTextPath');
|
||||
|
||||
+8
-9
@@ -1,11 +1,11 @@
|
||||
import React from "react";
|
||||
import { requireNativeComponent } from "react-native";
|
||||
import extractProps, { propsAndStyles } from "../lib/extract/extractProps";
|
||||
import { idPattern } from "../lib/util";
|
||||
import Shape from "./Shape";
|
||||
import React from 'react';
|
||||
import { requireNativeComponent } from 'react-native';
|
||||
import extractProps, { propsAndStyles } from '../lib/extract/extractProps';
|
||||
import { idPattern } from '../lib/util';
|
||||
import Shape from './Shape';
|
||||
|
||||
export default class Use extends Shape {
|
||||
static displayName = "Use";
|
||||
static displayName = 'Use';
|
||||
|
||||
static defaultProps = {
|
||||
x: 0,
|
||||
@@ -26,13 +26,12 @@ export default class Use extends Shape {
|
||||
href = xlinkHref,
|
||||
} = props;
|
||||
|
||||
// match "url(#pattern)"
|
||||
const matched = href.match(idPattern);
|
||||
const match = matched && matched[1];
|
||||
|
||||
if (!match) {
|
||||
console.warn(
|
||||
'Invalid `href` prop for `Use` element, expected a href like `"#id"`, but got: "' +
|
||||
'Invalid `href` prop for `Use` element, expected a href like "#id", but got: "' +
|
||||
href +
|
||||
'"',
|
||||
);
|
||||
@@ -54,4 +53,4 @@ export default class Use extends Shape {
|
||||
}
|
||||
}
|
||||
|
||||
const RNSVGUse = requireNativeComponent("RNSVGUse");
|
||||
const RNSVGUse = requireNativeComponent('RNSVGUse');
|
||||
|
||||
Reference in New Issue
Block a user