mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-08 09:10:44 +00:00
Lift default setNativeProps and refMethod implementation to Shape class
This commit is contained in:
+2
-8
@@ -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}
|
||||
|
||||
Reference in New Issue
Block a user