2019-06-23 00:45:32 +00:00
|
|
|
import React from 'react';
|
2019-06-29 05:49:08 +00:00
|
|
|
import { Route } from 'react-router';
|
2019-06-23 00:45:32 +00:00
|
|
|
import { CSSTransition, TransitionGroup } from 'react-transition-group';
|
|
|
|
|
|
|
|
type Props = Readonly<{
|
|
|
|
children: React.ReactNode;
|
|
|
|
}>;
|
|
|
|
|
2019-06-29 05:17:29 +00:00
|
|
|
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'}>
|
2019-06-29 05:17:29 +00:00
|
|
|
<section>
|
2020-04-17 18:17:01 +00:00
|
|
|
{children}
|
2019-06-29 05:17:29 +00:00
|
|
|
</section>
|
|
|
|
</CSSTransition>
|
|
|
|
</TransitionGroup>
|
|
|
|
)}
|
|
|
|
/>
|
2019-06-23 00:45:32 +00:00
|
|
|
);
|