mirror of
https://github.com/zoriya/react-native-svg.git
synced 2025-12-21 06:15:15 +00:00
38 lines
1.0 KiB
JavaScript
38 lines
1.0 KiB
JavaScript
import React from 'react';
|
|
import createReactNativeComponentClass from 'react-native/Libraries/Renderer/src/renderers/native/createReactNativeComponentClass';
|
|
import Shape from './Shape';
|
|
import {pathProps, fontProps} from '../lib/props';
|
|
import {GroupAttributes} from '../lib/attributes';
|
|
import extractProps from '../lib/extract/extractProps';
|
|
import {extractFont} from '../lib/extract/extractText';
|
|
|
|
export default class extends Shape{
|
|
static displayName = 'G';
|
|
|
|
static propTypes = {
|
|
...pathProps,
|
|
...fontProps,
|
|
};
|
|
|
|
setNativeProps = (...args) => {
|
|
this.root.setNativeProps(...args);
|
|
};
|
|
|
|
render() {
|
|
let {props} = this;
|
|
|
|
return <RNSVGGroup
|
|
{...extractProps(props, this)}
|
|
font={extractFont(props)}
|
|
ref={ele => {this.root = ele;}}
|
|
>
|
|
{props.children}
|
|
</RNSVGGroup>;
|
|
}
|
|
}
|
|
|
|
const RNSVGGroup = createReactNativeComponentClass({
|
|
validAttributes: GroupAttributes,
|
|
uiViewClassName: 'RNSVGGroup'
|
|
});
|