2019-06-22 17:45:32 -07:00
|
|
|
import React from 'react';
|
2019-06-28 22:49:08 -07:00
|
|
|
import { Route } from 'react-router';
|
2019-06-22 17:45:32 -07:00
|
|
|
import { CSSTransition, TransitionGroup } from 'react-transition-group';
|
|
|
|
|
|
|
|
type Props = Readonly<{
|
|
|
|
children: React.ReactNode;
|
|
|
|
}>;
|
|
|
|
|
2019-06-28 22:17:29 -07:00
|
|
|
export default ({ children }: Props) => (
|
|
|
|
<Route
|
|
|
|
render={({ location }) => (
|
|
|
|
<TransitionGroup className={'route-transition-group'}>
|
2019-07-27 20:23:44 -07:00
|
|
|
<CSSTransition key={location.key} timeout={250} in={true} appear={true} classNames={'fade'}>
|
2019-06-28 22:17:29 -07:00
|
|
|
<section>
|
2020-04-17 11:17:01 -07:00
|
|
|
{children}
|
2019-06-28 22:17:29 -07:00
|
|
|
</section>
|
|
|
|
</CSSTransition>
|
|
|
|
</TransitionGroup>
|
|
|
|
)}
|
|
|
|
/>
|
2019-06-22 17:45:32 -07:00
|
|
|
);
|