Add setNativeProps method for most of elements

This commit is contained in:
Horcrux
2016-07-18 18:34:54 +08:00
parent 2516a778ba
commit efa7363b6f
13 changed files with 74 additions and 3 deletions

View File

@@ -33,6 +33,14 @@ class G extends Component{
return _.defaults({}, this.context, context);
};
setNativeProps = (...args) => {
this.getNativeElement().setNativeProps(...args);
};
getNativeElement = () => {
return this.refs.root || this.root;
};
render() {
if (this.props.id) {
return <Defs.Item
@@ -42,12 +50,14 @@ class G extends Component{
>
<G
{...this.props}
ref={ele => this.root = ele.refs.root}
id={null}
/>
</Defs.Item>;
} else {
return <RNSVGGroup
{...extractProps(this.props, {transform: true})}
ref="root"
asClipPath={this.props.asClipPath}
>
{this.props.children}