fit-transmit-transparently
Version:
time-ago
28 lines (27 loc) • 858 B
JSX
const React = require('react');
const others_1 = require('../others');
const _ = require('lodash');
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = (ignore, isReactNative) => (Target) => {
class Transmit extends React.Component {
constructor(props) {
super(props);
this.state = {
others: {}
};
}
componentWillMount() {
this.state.others = others_1.default(Target.defaultProps, this.props, ignore, isReactNative);
}
render() {
const newProps = _.cloneDeep(this.props);
newProps.others = this.state.others;
return React.createElement(Target, newProps, this.props.children);
}
}
const func = () => {
return Transmit;
};
return func();
};
;