mirror of
https://github.com/zoriya/react-native-svg.git
synced 2025-12-20 22:05:14 +00:00
complete ClipPath refactor
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user