mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-01 22:25:12 +00:00
fix create native component issue
fix create native component issue
This commit is contained in:
+6
-9
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user