How could i get transition effect while mapping elements like: Based on http://reactcommunity.org/react-transition-group/css-transition I would like to have each element map with opacity 0, and within 1s opacity increased to 1. I've created sth like below, however, no effects appeared.
{ask.map((item, index) => {
return (
<CSSTransition
in={true}
timeout={500}
classNames="fade"
>
<tr>
<td>{item.ra}</td>
<td>{item.ca}</td>
<td>{(item.ra*item.ca).toFixed(2)}</td>
</tr>
</CSSTransition >
)
})}
CSS:
.fade {
opacity: 0 ;
}
.fade-enter-active {
opacity: 1;
transition: opacity 500ms;
}
.fade-exit {
opacity: 1;
}
.fade-exit-active {
opacity: 0;
transition: opacity 500ms;
}