Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import React from 'react';
import PropTypes from 'prop-types';
import { Platform } from 'react-native';
import { View as RNView, KeyboardAvoidingView } from 'react-native';
import { renderChildren } from '../helpers';
import { MergeTheme } from '../theme';
const LinearGradient = Platform.OS === 'ios' ?
require('react-native-linear-gradient/index.ios').default :
require('react-native-linear-gradient/index.android').default;
export default class View extends React.PureComponent {
constructor (props) {
super(props);
this.theme = MergeTheme(props.theme);
}
componentWillReceiveProps (nextProps) {
if (this.props.theme !== nextProps.theme) this.theme = MergeTheme(nextProps.theme)
}
render () {
let Component = RNView;
if (this.props.keyboardaware) Component = KeyboardAvoidingView;