wix-incubator / react-templates

Light weight templates for react
https://wix.github.io/react-templates
MIT License
2.82k stars 207 forks source link

React Animation - how to #172

Open Surt opened 8 years ago

Surt commented 8 years ago

Can anyone guide me to add animations in templates? I have an rt-repeat to render elements and I want to draw them with an animation. Any clue?

nippur72 commented 8 years ago

In theory it should be as easy as doing it in plain React, have a look at Animation in React.

The only difference might be the fact that you have to import ReactCSSTransitionGroup in the template:

<rt-import name="*" as="ReactCSSTransitionGroup" from="react-addons-css-transition-group" />

and then

<ReactCSSTransitionGroup transitionName="carousel" transitionEnterTimeout={300} transitionLeaveTimeout={300}>
   <div rt-repeat="item in myitems">{item}</div>
</ReactCSSTransitionGroup>