Skip to content

Latest commit

 

History

History
57 lines (34 loc) · 1.43 KB

README.md

File metadata and controls

57 lines (34 loc) · 1.43 KB

react-router-animation

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 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