Description:
An easy to use React component to slide between React routes. Works with React Router 4+.
How to use it:
1. Install & import the react-slide-routes.
# Yarn $ yarn add react-slide-routes # NPM $ npm install react-slide-routes --save
import SlideRoutes from 'react-slide-routes';
import { Route, useLocation } from 'react-router-dom';2. An example app showing how to slide routes in your React application.
const App = () => {
const location = useLocation();
return (
<>
<SlideRoutes location={location}>
<Route path="/" render={Home} exact />
<Route path="/category" render={Category} />
<Route path="/about" render={About} />
</SlideRoutes>
</>
);
};