complete ClipPath refactor

This commit is contained in:
Horcrux
2016-07-20 14:44:19 +08:00
parent dd6cb80e84
commit 18e1b60823
30 changed files with 254 additions and 251 deletions

View File

@@ -1,31 +1,14 @@
import React, {Component, PropTypes} from 'react';
import _ from 'lodash';
import createReactNativeComponentClass from 'react/lib/createReactNativeComponentClass';
import {numberProp, contextProps} from '../lib/props';
import {transformProps} from '../lib/props';
import {GroupAttributes} from '../lib/attributes';
import extractProps from '../lib/extract/extractProps';
class G extends Component{
static displayName = 'G';
static contextTypes = {
...contextProps
};
static childContextTypes = {
...contextProps
};
getChildContext = () => {
let context = _.reduce(contextProps, (props, value, key) => {
if (!_.isNil(this.props[key])) {
props[key] = this.props[key];
}
return props;
}, {});
return _.defaults({}, this.context, context);
};
static propTypes = transformProps;
setNativeProps = (...args) => {
this.root.setNativeProps(...args);