Pterodactyl-Panel/resources/scripts/TransitionRouter.tsx
2020-07-03 14:19:05 -07:00

20 lines
618 B
TypeScript

import React from 'react';
import { Route } from 'react-router';
import { CSSTransition, TransitionGroup } from 'react-transition-group';
const TransitionRouter: React.FC = ({ children }) => (
<Route
render={({ location }) => (
<TransitionGroup className={'route-transition-group'}>
<CSSTransition key={location.key} timeout={250} in appear classNames={'fade'}>
<section>
{children}
</section>
</CSSTransition>
</TransitionGroup>
)}
/>
);
export default TransitionRouter;