mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-08 09:10:44 +00:00
fix #63
This commit is contained in:
+4
-6
@@ -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,
|
||||||
|
|||||||
Reference in New Issue
Block a user