mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-06 16:32:24 +00:00
Add examples and refactor code
Add examples and refactor code
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import React, {
|
||||
Component,
|
||||
PropTypes
|
||||
} from 'react-native';
|
||||
import Ellipse from './Ellipse';
|
||||
|
||||
let propType = PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired;
|
||||
class Circle extends Component{
|
||||
static displayName = 'Circle';
|
||||
static propTypes = {
|
||||
cx: propType,
|
||||
cy: propType,
|
||||
r: propType
|
||||
};
|
||||
render() {
|
||||
return <Ellipse
|
||||
{...this.props}
|
||||
r={null}
|
||||
rx={this.props.r}
|
||||
ry={this.props.r}
|
||||
/>
|
||||
}
|
||||
}
|
||||
|
||||
export default Circle;
|
||||
Reference in New Issue
Block a user