fix create native component issue

fix create native component issue
This commit is contained in:
Horcrux
2016-05-15 10:50:53 +08:00
parent 8d01e8eccb
commit 233ea81a4a
13 changed files with 77 additions and 97 deletions
+6 -9
View File
@@ -1,11 +1,10 @@
import React, {Component, PropTypes} from 'react';
import _ from 'lodash';
import Defs from './Defs';
import createReactNativeComponentClass from 'react-native/Libraries/ReactNative/createReactNativeComponentClass';
import extractProps from '../lib/extract/extractProps';
import SerializablePath from '../lib/SerializablePath';
import {PathAttributes} from '../lib/attributes';
import {pathProps} from '../lib/props';
import createNativeComponent from '../lib/createNativeComponent';
import {pathProps, numberProp} from '../lib/props';
class Path extends Component{
static displayName = 'Path';
@@ -17,7 +16,8 @@ class Path extends Component{
static contextTypes = {
...pathProps,
isInGroup: PropTypes.bool
isInGroup: PropTypes.bool,
svgId: numberProp
};
@@ -51,7 +51,7 @@ class Path extends Component{
let d = new SerializablePath(props.d).toJSON();
return (
<NativePath
<RNSVGPath
{...extractProps(props)}
d={d}
/>
@@ -59,9 +59,6 @@ class Path extends Component{
}
}
let NativePath = createReactNativeComponentClass({
validAttributes: PathAttributes,
uiViewClassName: 'RNSVGPath'
});
const RNSVGPath = createNativeComponent('RNSVGPath');
export default Path;