Here is my code:
import styles from 'styles.css';
// other code
render() {
return <CSSTransition
classNames= {{
enter: 'example-enter',
enterActive: 'example-enter-active',
exit: 'example-leave',
exitActive: 'example-leave-active'
}}
in={true}
timeout={300}
onEnter = { () => console.log('mounting') }
unmountOnExit
>
<div className={styles['someclass']}>Will animate</div>
</CSSTransition>
}
How I use the styles array for setting classes on the transition group? I have tried setting the classes as styles['example-enter'], styles['example-leave']
etc. but no luck. Additionally my onEnter handler doesn't work!
Note: It is classNames
for the transition and className
for CX, so it is not a typo.