import * as React from 'react' ; import { ReactElement } from 'react' ; import { PlaceholderProps } from '../components/Placeholder' ; import { Fade , collapseDuration } from './transitions' ; import { GroupBase } from '../types' ; export type PlaceholderComponent = < Option , IsMulti extends boolean , Group extends GroupBase < Option > > ( props : PlaceholderProps < Option , IsMulti , Group > ) => ReactElement ; const AnimatedPlaceholder = ( WrappedComponent ) => < Option , IsMulti extends boolean , Group extends GroupBase < Option > > ( props ) => ( < Fade < PlaceholderProps < Option , IsMulti , Group > > component = { WrappedComponent } duration = { props . isMulti ? collapseDuration : 1 } { ... props } />); export default AnimatedPlaceholder ;