1 | import React from 'react';
|
2 | import { requireNativeComponent } from 'react-native';
|
3 | import { withoutXY } from '../lib/extract/extractProps';
|
4 | import { NumberProp } from '../lib/extract/types';
|
5 | import G from './G';
|
6 |
|
7 | export default class ForeignObject extends G<{
|
8 | x?: NumberProp;
|
9 | y?: NumberProp;
|
10 | width?: NumberProp;
|
11 | height?: NumberProp;
|
12 | }> {
|
13 | static displayName = 'ForeignObject';
|
14 |
|
15 | static defaultProps = {
|
16 | x: '0%',
|
17 | y: '0%',
|
18 | width: '100%',
|
19 | height: '100%',
|
20 | };
|
21 |
|
22 | render() {
|
23 | const { props } = this;
|
24 | const { x, y, width, height, children } = props;
|
25 | return (
|
26 | <RNSVGForeignObject
|
27 | ref={this.refMethod}
|
28 | {...withoutXY(this, props)}
|
29 | x={x}
|
30 | y={y}
|
31 | width={width}
|
32 | height={height}
|
33 | >
|
34 | {children}
|
35 | </RNSVGForeignObject>
|
36 | );
|
37 | }
|
38 | }
|
39 |
|
40 | export const RNSVGForeignObject = requireNativeComponent('RNSVGForeignObject');
|