popup-ui-custom
Version:
Rafael Augusto's React Native Popup UI base project with some updates to be compliant with React 0.70 (fixes deprecated-react-native-prop-types error)
44 lines (38 loc) • 833 B
JavaScript
import React, { Component } from 'react'
import { View } from 'react-native'
import { ViewPropTypes } from 'deprecated-react-native-prop-types';
import PropTypes from 'prop-types'
import Popup from '../Popup'
import Toast from '../Toast'
class Root extends Component {
render() {
return (
<View
ref={c => (this._root = c)}
style={{ flex: 1 }}
{...this.props}
>
{this.props.children}
<Popup
ref={c => {
if (c) Popup.popupInstance = c
}}
/>
<Toast
ref={c => {
if (c) Toast.toastInstance = c
}}
/>
</View>
)
}
}
Root.propTypes = {
...ViewPropTypes,
style: PropTypes.oneOfType([
PropTypes.object,
PropTypes.number,
PropTypes.array
])
}
export default Root