mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-08 01:00:43 +00:00
36 lines
986 B
JavaScript
36 lines
986 B
JavaScript
import React from "react";
|
|
import { requireNativeComponent } from "react-native";
|
|
import extractProps from "../lib/extract/extractProps";
|
|
import { extractFont } from "../lib/extract/extractText";
|
|
import extractTransform from "../lib/extract/extractTransform";
|
|
import Shape from "./Shape";
|
|
|
|
export default class G extends Shape {
|
|
static displayName = "G";
|
|
|
|
setNativeProps = props => {
|
|
const matrix = !props.matrix && extractTransform(props);
|
|
if (matrix) {
|
|
props.matrix = matrix;
|
|
}
|
|
this.root.setNativeProps(props);
|
|
};
|
|
|
|
render() {
|
|
const { props } = this;
|
|
return (
|
|
<RNSVGGroup
|
|
{...extractProps(props, this)}
|
|
font={extractFont(props)}
|
|
ref={ele => {
|
|
this.root = ele;
|
|
}}
|
|
>
|
|
{props.children}
|
|
</RNSVGGroup>
|
|
);
|
|
}
|
|
}
|
|
|
|
const RNSVGGroup = requireNativeComponent("RNSVGGroup");
|