I'm trying to create a modal to logout of my application, it's a simple one, the modal shows up, 2 buttons, yes and no, if yes, the user log out. The problem is that the modal doesn't run the logout function and if I put the button out of the modal it works...Heres the code:the button:
export function SignOutBox() { const { secondary80, secondary100 } = theme.colors; const { signOut } = useAuth(); return (<Container> ...<ButtonYes onPress={signOut}><ButtonText> Yes
the modal:
interface IModalLogoutProps extends ModalProps { children: ReactNode; closeModal: () => void;}export function ModalLogout({ children, closeModal, ...rest }: IModalLogoutProps) { return (<Modal transparent animationType="slide" statusBarTranslucent {...rest}><TouchableWithoutFeedback onPress={closeModal}><Overlay><ContentContainer><Background> {children}
the modal in the component that run it:
<ModalLogout visible={openLogoutModal} closeModal={handleCloseLogoutModal}><SignOutBox /></ModalLogout>