Skip to content

Commit

Permalink
Fixed issue #19 Integration with react-navigation
Browse files Browse the repository at this point in the history
  • Loading branch information
maksimko committed Mar 2, 2020
1 parent e5c4e38 commit 170ae9d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/components/Modal/Modal.android.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ type Props = {
};

const Modal = ({ visible, children, onRequestClose }: Props) => {
if (!visible) {
return null;
}

useEffect(() => {
const backHandler = BackHandler.addEventListener(
"hardwareBackPress",
Expand All @@ -34,7 +38,7 @@ const Modal = ({ visible, children, onRequestClose }: Props) => {
};
}, []);

return <>{visible && <View style={styles.root}>{children}</View>}</>;
return <View style={styles.root}>{children}</View>;
};

const styles = StyleSheet.create({
Expand Down

0 comments on commit 170ae9d

Please sign in to comment.