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

@@ -25,6 +25,14 @@ class Text extends Shape {
svgId: numberProp
};
setNativeProps = (...args) => {
this.getNativeElement().setNativeProps(...args);
};
getNativeElement = () => {
return this.refs.root || this.root;
};
render() {
let props = mergeContext(this.props, this.context);
@@ -39,6 +47,7 @@ class Text extends Shape {
if (this.props.id) {
return <Defs.Item
ref={ele => this.root = ele.refs.root}
id={this.props.id}
svgId={this.props.svgId}
visible={true}
@@ -50,6 +59,7 @@ class Text extends Shape {
return (
<RNSVGText
ref="root"
{...extractProps({...props, x, y})}
{...extractText(props)}
/>