@steveeeie/react-page-transition
Advanced tools
Comparing version
{ | ||
"name": "@steveeeie/react-page-transition", | ||
"version": "1.1.1", | ||
"version": "1.1.2", | ||
"description": "A React component that makes it easy to implement the page transitions from the Codedrops page transitions demo", | ||
@@ -5,0 +5,0 @@ "files": [ |
# React Page Transition | ||
<img alt="License" src="https://img.shields.io/npm/l/@steveeeie/react-page-transition" /> <img alt="Version" src="https://img.shields.io/npm/v/@steveeeie/react-page-transition"> <img alt="Size" src="https://img.shields.io/bundlephobia/min/@steveeeie/react-page-transition"> <img alt="PRs" src="https://img.shields.io/badge/PRs-Welcome-brightgreenn"> | ||
<a href="https://www.twitter.com/steveeeie"><img alt="Twitter Follow" src="https://img.shields.io/twitter/follow/steveeeie?style=social"></a> | ||
## Demo | ||
@@ -35,3 +38,3 @@ | ||
import { BrowserRouter, Switch, Route } from 'react-router-dom'; | ||
import PageTransition from '@steveeeie/react-page-transition'; | ||
import { PageTransition } from '@steveeeie/react-page-transition'; | ||
@@ -43,10 +46,11 @@ function Routes() { | ||
render={({ location }) => ( | ||
<PageTransition | ||
preset="moveToLeftFromRight" | ||
transitionKey={location.pathname}> | ||
<Switch location={location}> | ||
<Route to="/home" component={Home} /> | ||
<Route to="/about" component={About} /> | ||
</Switch> | ||
</PageTransition> | ||
<PageTransition | ||
preset="moveToLeftFromRight" | ||
transitionKey={location.pathname} | ||
> | ||
<Switch location={location}> | ||
<Route to="/home" component={Home} /> | ||
<Route to="/about" component={About} /> | ||
</Switch> | ||
</PageTransition> | ||
)} | ||
@@ -53,0 +57,0 @@ /> |
Sorry, the diff of this file is not supported yet
53222
0.95%70
6.06%