Lift default setNativeProps and refMethod implementation to Shape class

This commit is contained in:
Mikael Sand
2019-01-09 01:02:22 +02:00
parent f7c71a7ecd
commit ca611a4416
21 changed files with 40 additions and 122 deletions
+2 -8
View File
@@ -1,5 +1,5 @@
import React from "react";
import {requireNativeComponent} from "react-native";
import { requireNativeComponent } from "react-native";
import extractProps from "../lib/extract/extractProps";
import { idPattern } from "../lib/util";
import Shape from "./Shape";
@@ -12,10 +12,6 @@ export default class Use extends Shape {
height: 0,
};
setNativeProps = props => {
this.root.setNativeProps(props);
};
render() {
const { props } = this;
const { children, width, height, href } = props;
@@ -34,9 +30,7 @@ export default class Use extends Shape {
return (
<RNSVGUse
ref={ele => {
this.root = ele;
}}
ref={this.refMethod}
{...extractProps(props, this)}
href={match}
width={width}