react-router-transition-group
v2.0.5
Published
Transitions for react-router
Downloads
16
Readme
react-router-transition-group
Transitions for react-router.
Installation
npm install react-router-transition-group
Demo
Usage
- Add
transition
property toSwitch
component - You also can override
transition
for eachRoute
component transition
is a Transition component fromreact-transition-group
- To disable transitions between some routes, you can group them by passing the same
transitionKey
property toRoute
component
import React from 'react'
import { Route } from 'react-router-dom'
import { Switch } from 'react-router-transition-group'
import MyTransition from 'components/MyTransition'
import HomePage from 'components/HomePage'
import NotFoundPage from 'components/NotFoundPage'
export default () => (
<Switch transition={MyTransition} component={Fragment} exit>
<Route exact path="/" component={HomePage} />
<Route component={NotFoundPage} />
</Switch>
)