UNPKG

react-native-template-agile-rn

Version:

<h3 align="center"> <b>Agile RN</b> is a <b>React Native ⚛ template</b> that was created to <i>speed up project start-up</i> as well as make <i>app development easier</i>. <h3>

37 lines (31 loc) 719 B
import React from 'react'; import PropTypes from 'prop-types'; import { Wrapper, SafeView, KeyboardView } from './styles'; export default function Block({ container, children, ...rest }) { if (container) { return ( <SafeView> <KeyboardView> <Wrapper container={container} {...rest}> {children} </Wrapper> </KeyboardView> </SafeView> ); } return ( <Wrapper container={container} {...rest}> {children} </Wrapper> ); } Block.defaultProps = { container: false, }; Block.propTypes = { container: PropTypes.bool, children: PropTypes.oneOfType([ PropTypes.arrayOf(PropTypes.node), PropTypes.node, ]).isRequired, };