UNPKG

674 BTypeScriptView Raw
1import React from 'react';
2import { extract } from '../lib/extract/extractProps';
3import { NumberProp } from '../lib/extract/types';
4import Shape from './Shape';
5import { RNSVGEllipse } from './NativeComponents';
6
7export default class Ellipse extends Shape<{
8 cx?: NumberProp;
9 cy?: NumberProp;
10 rx?: NumberProp;
11 ry?: NumberProp;
12}> {
13 static displayName = 'Ellipse';
14
15 static defaultProps = {
16 cx: 0,
17 cy: 0,
18 rx: 0,
19 ry: 0,
20 };
21
22 render() {
23 const { props } = this;
24 const { cx, cy, rx, ry } = props;
25 const ellipseProps = { ...extract(this, props), cx, cy, rx, ry };
26 return <RNSVGEllipse ref={this.refMethod} {...ellipseProps} />;
27 }
28}