Super easy magic-move transitions for React apps
Super easy magic-move transitions for React apps
Super easy magic-move transitions for React apps.
$ npm install react-overdrive --save
Wrap any element (not just images) in a <Overdrive id=""></Overdrive> component. Add the same id to create a transition between the elements.
On page1.js:
import Overdrive from 'react-overdrive'
const pageA = (props) => (
);
On page2.js:
import Overdrive from 'react-overdrive'
const pageB = (props) => (
);
Now route between the pages.
On page.js:
import Overdrive from 'react-overdrive'
const page = (props) => (
);
1 usually helps avoiding issues with window scrolling.
null
onAnimationEnd
Event dispatched when the animation has finished.
null
A transition is made when an <Overdrive id="example"/> component is unmounted and another <Overdrive id="example"/> is mounted not later than 100ms.
The transition is made by cloning the unmounted and mounted components, adding them with absolute position and CSS transformed from the source to the target position.
Thanks to the following companies for generously providing their services/products to help improve this project:
Thanks to BrowserStack for providing cross-browser testing.
Tal Bereznitskey. Find me on Twitter as @ketacode.
No open issues yet, or sync has not completed.