1
1
mirror of https://github.com/pterodactyl/panel.git synced 2024-11-23 09:32:29 +01:00
Pterodactyl-Panel/resources/scripts/TransitionRouter.tsx
2020-04-17 11:17:01 -07:00

22 lines
645 B
TypeScript

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'}>
<CSSTransition key={location.key} timeout={250} in={true} appear={true} classNames={'fade'}>
<section>
{children}
</section>
</CSSTransition>
</TransitionGroup>
)}
/>
);