mirror of
https://github.com/zoriya/react-native-svg.git
synced 2025-12-20 05:55:10 +00:00
Move serialize path to native side
This commit is contained in:
@@ -1,5 +1,4 @@
|
|||||||
import React, {PropTypes} from 'react';
|
import React, {PropTypes} from 'react';
|
||||||
import SerializablePath from '../lib/SerializablePath';
|
|
||||||
import createReactNativeComponentClass from 'react-native/Libraries/Renderer/src/renderers/native/createReactNativeComponentClass';
|
import createReactNativeComponentClass from 'react-native/Libraries/Renderer/src/renderers/native/createReactNativeComponentClass';
|
||||||
import {PathAttributes} from '../lib/attributes';
|
import {PathAttributes} from '../lib/attributes';
|
||||||
import Shape from './Shape';
|
import Shape from './Shape';
|
||||||
@@ -20,12 +19,11 @@ class Path extends Shape {
|
|||||||
render() {
|
render() {
|
||||||
let props = this.props;
|
let props = this.props;
|
||||||
|
|
||||||
let d = new SerializablePath(props.d).toJSON();
|
|
||||||
return (
|
return (
|
||||||
<RNSVGPath
|
<RNSVGPath
|
||||||
ref={ele => {this.root = ele;}}
|
ref={ele => {this.root = ele;}}
|
||||||
{...this.extractProps(props)}
|
{...this.extractProps(props)}
|
||||||
d={d}
|
d={props.d}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -99,9 +99,7 @@ const UseAttributes = merge({
|
|||||||
}, RenderableAttributes);
|
}, RenderableAttributes);
|
||||||
|
|
||||||
const PathAttributes = merge({
|
const PathAttributes = merge({
|
||||||
d: {
|
d: true
|
||||||
diff: arrayDiffer
|
|
||||||
}
|
|
||||||
}, RenderableAttributes);
|
}, RenderableAttributes);
|
||||||
|
|
||||||
const TextAttributes = merge({
|
const TextAttributes = merge({
|
||||||
|
|||||||
Reference in New Issue
Block a user