Move serialize path to native side

This commit is contained in:
Horcrux
2017-01-06 14:57:06 +08:00
parent 4112d60c52
commit 0a6dc56b68
2 changed files with 2 additions and 6 deletions

View File

@@ -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}
/> />
); );
} }

View File

@@ -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({