UNPKG

@ecreeth/rn-ui

Version:

Highly customizable and theming components for React Native

41 lines (35 loc) 773 B
import React, { PureComponent } from 'react'; import PropTypes from 'prop-types'; import { View as RNView } from 'react-native'; const propTypes = { checkedValue: PropTypes.string, onChange: PropTypes.func, }; const defaultProps = { checkedValue: undefined, onChange: () => {}, }; const childContextTypes = { checkedValue: PropTypes.string, onChange: PropTypes.func, }; class Group extends PureComponent { getChildContext() { const { checkedValue, onChange } = this.props; return { checkedValue, onChange, }; } render() { return ( <RNView {...this.props} /> ); } } Group.propTypes = propTypes; Group.defaultProps = defaultProps; Group.childContextTypes = childContextTypes; export default Group;