react-router-animation
v1.0.10
Published
Simple HOC for creating sliding transitions between react-router components
Downloads
9
Readme
react-router-animation
- react-router-animation - NPM link
- Live Demo
react-router-animation is a lightweight, simple component for adding a sliding animation transition when swapping between react-router components. MUST be using react-router-dom for this package to work.
Getting Started
In the root directory of your project:
npm install --save react-router-animation
OR
yarn add react-router-animation
Prerequisites
Place the following import in the file where your routes are(for me App.js):
import SwitchWithSlide from "react-router-animation";
After Installing
Wrap your routes in App.js or wherever you have them in the HOC provided by react-router-animation
<SwitchWithSlide>
<Route exact path="/" component={Home} />
<Route exact path="/page" component={Page} />
</SwitchWithSlide>
Built With
- React - JS framework
- classnames - Only dependency used to conditionally assign class names
Contributing
All contribution welcome :) Open an issue, submit a pull request, or contact me directly!
Authors
License
This project is licensed under the ISC License - see the LICENSE.md file for details