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

How to make the animation of the modal be executed before the modal disappears on the screen? react

$
0
0

I have a modal that makes animation when entering and exiting the screen, but when exiting it simply disappears before making the animation, I can't identify the error. Can anyone help? my code:

displayModal ? (<Background><Backdrop onClick={closeModal} /><Container closeModal={closeModal} displayModal={displayModal}>        {children}</Container></Background>  ) : null;//animationsconst animationIn = keyframes`  from {    transform: translateY(100vh);  }  to {    transform: translateY(0);  }`;const animationOut = keyframes`  from {    transform: translateY(0);  }  to {    transform: translateY(100vh);  }`;const Container = styled.div<ContainerProps>`  visibility: visible;  display: flex;  width: 100%;  flex-direction: column;  align-items: center;  background: #ffffff;  animation: ${({ displayModal }) =>    displayModal      ? css`          ${animationIn} 0.5s ease-out forwards;        `      : css`          ${animationOut} 0.5s ease-out forwards;        `};  z-index: 600;  bottom: 0;`;

basically, in the animation of input it works normal, but when I click to close the modal, it disappears quickly, instead of making the animation out


Viewing all articles
Browse latest Browse all 6287

Trending Articles



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