refactor Components props extracting

This commit is contained in:
Horcrux
2017-02-03 19:43:25 +08:00
parent 9b62d500ce
commit 5bd9b40c17
35 changed files with 208 additions and 276 deletions
+3 -4
View File
@@ -3,8 +3,9 @@ import createReactNativeComponentClass from 'react-native/Libraries/Renderer/src
import Shape from './Shape';
import {pathProps, numberProp} from '../lib/props';
import {EllipseAttributes} from '../lib/attributes';
import extractProps from '../lib/extract/extractProps';
class Ellipse extends Shape{
export default class extends Shape{
static displayName = 'Ellipse';
static propTypes = {
@@ -31,7 +32,7 @@ class Ellipse extends Shape{
return <RNSVGEllipse
ref={ele => {this.root = ele;}}
{...this.extractProps(props)}
{...extractProps(props, this)}
cx={props.cx.toString()}
cy={props.cy.toString()}
rx={props.rx.toString()}
@@ -44,5 +45,3 @@ const RNSVGEllipse = createReactNativeComponentClass({
validAttributes: EllipseAttributes,
uiViewClassName: 'RNSVGEllipse'
});
export default Ellipse;