This is within my component file
<CSSTransition
classNames="method"
in={radio === 'add-card'}
exit={radio !== 'add-card'}
timeout={500}
unmountOnExit>
<div className=" ">
Hello
</div>
</CSSTransition>
This is my css file
.method-enter {
opacity: 0;
transition: opacity 500ms ease-in;
}
.method-enter-active {
opacity: 1;
}
.method-exit {
opacity: 1;
transition: opacity 500ms ease-out;
}
.method-exit-active {
opacity: 0;
}
My CSSTransition is supposed to start off inactive. When I set the condition to true, there is no fade-in animation. It just appears instantly. Setting the condition to false makes the transition disappear after 500ms instead of fading out.
Is there something wrong with my css? My goal is to make the enter and exit a 500ms fade-in and fade-out.