Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

Modal doesn't run any function

$
0
0

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>

Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>