react-native-popper
react-native-popper copied to clipboard
Add customizable `Modal` component from react-native-screens
Now that react-native-screens
has an overlay view that allows multiple overlays on iOS (and in the future Android), it would be great if this lib exposed a way to pass a custom Modal
component. I envision something roughly like this:
const CustomModal = (props) => {
if (Platform.OS !== 'ios') {
return <Modal {...props} />
}
const { visible, children } = props
return <OverlayView style={StyleSheet.absoluteFill}>{visible && children}</OverlayView>
}
return <Popover Modal={CustomModal} />
Even better, what if this library had a plugin, like react-native-popper/window
, such that all you had to do is this:
import { WindowOverlay } from 'react-native-popper/window'
<Popover Modal={WindowOverlay} />
This way, only users of react-native-popper/window
need to install react-native-screens
.
Perhaps even better, would be that if you're using react-native-popper/window
, then on iOS, it automatically enables that view from react-native-screens (dev dependency) for you!
Everything else would be the same, just re-exports the same things with the custom overlay under the hood.
Love the idea of having a plugin like react-native-popper/window
!