import * as React from 'react' ; import { ReactElement } from 'react' ; import { TransitionProps } from 'react-transition-group/Transition' ; import { InputProps } from '../components/Input' ; import { GroupBase } from '../types' ; export type InputComponent = < Option , IsMulti extends boolean , Group extends GroupBase < Option > > ( props : InputProps < Option , IsMulti , Group > ) => ReactElement ; export type AnimatedInputProps < Option , IsMulti extends boolean , Group extends GroupBase < Option > > = InputProps < Option , IsMulti , Group > & Partial < TransitionProps > ; const AnimatedInput = ( WrappedComponent ) : InputComponent => { return < Option , IsMulti extends boolean , Group extends GroupBase < Option > > ( { in : inProp , onExited , appear , enter , exit , ... props } ) => ( < WrappedComponent { ... props } / > ) ; } ; export default AnimatedInput ;