Skip to content

How to replicate the native Modal functionality #1620

Answered by shessafridi
shessafridi asked this question in Q&A
Discussion options

You must be logged in to vote

UPDATE, I ended up doing something like this

import { ComponentProps, useEffect, useRef } from 'react';
import { BackHandler } from 'react-native';

import { BottomSheetModal, BottomSheetModalProvider } from '@gorhom/bottom-sheet';
import colors from '@src/config/colors';
import { useIsDarkMode } from '@src/hooks/theme/useIsDarkMode';
import { StyledPressable } from '@src/utils/styled-components';

type Props = {
  visible: boolean;
  onRequestClose?: () => void;
} & ComponentProps<typeof BottomSheetModal>;

const BottomSheet = ({ visible, onRequestClose, ...props }: Props) => {
  const bottomSheetModalRef = useRef<BottomSheetModal>(null);
  const isDarkMode = useIsDarkMode();

  useEffec…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by shessafridi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant