import React, { FC, memo } from 'react'; import { cn } from '../../util/bem'; import { AnimatedWrapperTransition } from './animated-wrapper-transition.component'; import { useDynamicHeight } from './animated-wrapper.hook'; import './animated-wrapper.component.scss'; const className = cn('animated-wrapper'); export type AnimatedWrapperPropsType = { className?: string; children: React.ReactNode; transitionFade?: boolean; transitionHeight?: boolean; manual?: boolean; initialHeight?: string; fullWidth?: boolean; style?: React.CSSProperties; } export const AnimatedWrapper: FC = memo((props) => { const [ ref, height ] = useDynamicHeight(props.initialHeight, props.transitionHeight); return (
{ props.children }
); }); AnimatedWrapper.defaultProps = { initialHeight: 'auto' };