import React, { FC } from 'react'; import { CSSTransition } from 'react-transition-group'; import { CSSTransitionProps } from 'react-transition-group/CSSTransition'; type AnimationName = | 'zoom-in-top' | 'zoom-in-left' | 'zoom-in-bottom' | 'zoom-in-right'; interface TransitionProps extends CSSTransitionProps { animation?: AnimationName; classNames?: string; wrapper?: boolean; } export const Transition: FC = (props) => { const { children, classNames, animation, wrapper, ...restProps } = props; return ( {wrapper ?
{children}
: children}
); }; Transition.defaultProps = { unmountOnExit: true, appear: true, }; export default Transition;