1.2.0 • Published 6 years ago

react-transition-hooks v1.2.0

Weekly downloads
1,577
License
BSD-3-Clause
Repository
github
Last release
6 years ago

React Transition Hooks

The goal of this component is supply a better alternative to ReactTransitionGroup. Why? Because, ReactTransitionGroup animations can not be interrupted. So, if you are with a component entering the group it can not leave until the entering phase is complete. Plus, Facebook will drop support for ReactTransitionGroup soon.

If you have a component currently using ReactTransitionGroup you can just change your import with this component and everything should work as expected.

Demo using ReactInlineTransitionGroup

How to install

npm install react-transition-hooks

Hooks

This component uses the same API names of ReactTransitionGroup.

  • componentWillAppear(callback): Called right after componentDidMount. This is called for the children inside the group for the first render. After the first render this will never be called again.

  • componentDidAppear(): Called when the callback passed to componentWillAppear is called.

  • componentWillEnter(callback): Called when a component just entered the group.

  • componentDidEnter(): Called when the callback passed to componentWillEnter is called.

  • componentWillLeave(callback): Called when a component is leaving the group.

  • componentDidLeave(): Called when the callback passed to componentWillLeave is called. This is called right after componentWillUnmount.

Properties

Property nameDescription
componentThe component that will wrap all the children. Default: span

LICENSE

BSD-3

1.2.0

6 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.10

7 years ago

1.0.9

7 years ago

1.0.8

7 years ago

1.0.7

7 years ago

1.0.6

7 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago