This commit is contained in:
Horcrux
2016-07-27 17:41:24 +08:00
parent 0fd92e30ea
commit fece0c0812
+4 -6
View File
@@ -1,6 +1,7 @@
import React, {Component, PropTypes} from 'react'; import React, {Component, PropTypes} from 'react';
import {View, requireNativeComponent, StyleSheet} from 'react-native'; import {View, requireNativeComponent, StyleSheet} from 'react-native';
import ViewBox from './ViewBox'; import ViewBox from './ViewBox';
import _ from 'lodash';
// Svg - Root node of all Svg elements // Svg - Root node of all Svg elements
let id = 0; let id = 0;
@@ -70,14 +71,11 @@ class Svg extends Component{
preserveAspectRatio={props.preserveAspectRatio} preserveAspectRatio={props.preserveAspectRatio}
>{props.children}</ViewBox> : props.children; >{props.children}</ViewBox> : props.children;
const nativeProps = _.omit(props, ['width', 'height', 'viewBox', 'preserveAspectRatio', 'opacity']);
return ( return (
<NativeSvgView <NativeSvgView
{...props} {...nativeProps}
opacity={null}
width={null}
height={null}
viewBox={null}
preserveAspectRatio={null}
ref={ele => {this.root = ele;}} ref={ele => {this.root = ele;}}
style={[ style={[
styles.svg, styles.svg,