1.0.4 • Published 10 years ago

directions-transition-group v1.0.4

Weekly downloads
3
License
MIT
Repository
github
Last release
10 years ago

This is a small extension of Facebook's TransitionGroup and TransitionGroupChild components from React source code.

What's changed

TransitionGroup listens for bubbling click events from elements inside it and looks for data-direction attribute. Then, it sets a class for animated element: <animation name>-direction-<direction name>.

There is also a setDirection method on TransitionGroup to set direction name programmatically.

Usage

var TransitionGroup = require('directions-transition-group');

// Wrap your element

<TransitionGroup name="slide" ref="tg">
  <RouteHandler />
</TransitionGroup>

// Assign data-direction attribute

<a href="#next" data-direction="forward">Next</a> //will add .slide-direction-forward class when animating elements
<Link to="step-one" data-direction="whatever">Back</Link> //will add .slide-direction-whatever class when animating elements

// "API"
this.refs.tg.setDirection("swap");
1.0.4

10 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago