misc_pterodactyl-panel/resources/scripts/TransitionRouter.tsx

22 lines
645 B
TypeScript
Raw Normal View History

import React from 'react';
import { Route } from 'react-router';
import { CSSTransition, TransitionGroup } from 'react-transition-group';
type Props = Readonly<{
children: React.ReactNode;
}>;
export default ({ children }: Props) => (
<Route
render={({ location }) => (
<TransitionGroup className={'route-transition-group'}>
2019-07-28 03:23:44 +00:00
<CSSTransition key={location.key} timeout={250} in={true} appear={true} classNames={'fade'}>
<section>
{children}
</section>
</CSSTransition>
</TransitionGroup>
)}
/>
);