1.2.0 • Published 8 years ago

react-csstransitgroup v1.2.0

Weekly downloads
2
License
ISC
Repository
github
Last release
8 years ago

react-csstransitgroup

Replacement for React's css transition group addon. It's API and feature set are much simpler, but is has far less dependacies than React's does. And it's only a 100 LOC!

install

npm install react-csstransitgroup

how to use

var CssTransitGroup = require('react-csstransitgroup');

var TodoList = React.createClass({
	getDefaultProps: function() {
		return {
			items : []
		};
	},

	render : function(){
		return <CssTransitGroup className='todoList' timeout={500}>
			{this.props.items}
		</CssTransitGroup>
	},
})

props

CssTransitGroup has three props you can pass it:

  • enterClassName default: 'enter' - the class given to the items upon entering. Removed after the timeout.
  • leaveClassName default: 'leave' - the class given to the items upon leaving. Removed after the timeout.
  • timeout default: 250 - Number of milliseconds your animations are.

note : All children must have keys. Otherwise React will be mad.