So, I have a tiny part of code where I'm trying to add an animation as wrapper for Tooltip Nodes
. But perhaps I do something wrong, because I do not see on the screen any animation
appearing during mount
.
Moreover, it even does not fire console.log
on onEnter
event. Why?
Thanks.
import React, { PureComponent } from 'react'
import { CSSTransition } from 'react-transition-group'
import styles from './index.scss'
import './anim.scss'
class ToolTip extends PureComponent {
render() {
return (
<CSSTransition
in={true}
classNames={'tooltip'}
timeout={3000}
onEnter={() => { console.log('FIRED!') }}
>
<div className={`${styles.tooltipContainer}`}>
<span className={styles.title}>{'title'}</span>
</div>
</CSSTransition>
)
}
}
export default ToolTip
Edit:
my anim.scss
file:
.tooltip-enter {
opacity: 0;
&.tooltip-enter-active {
opacity: 1;
}
}
.tooltip-exit {
opacity: 1;
&.tooltip-exit-active {
opacity: 0;
}
}