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