import React , { forwardRef } from 'react' ; import { BoxProps } from '../../Box' ; import { FlexedItemProps } from '../types' ; import { StyledFlexItem } from './styled' ; interface PrivateProps { forwardedRef : React . Ref < HTMLDivElement > ; } export type FlexItemProps = BoxProps & FlexedItemProps ; const RawFlexItem = ( { as , forwardedRef , ... props } ) => ( < StyledFlexItem ref = { forwardedRef } forwardedAs = { as } { ... props } />); export const FlexItem = forwardRef < HTMLDivElement , FlexItemProps > ( ( props , ref ) => ( < RawFlexItem { ... props } forwardedRef = { ref } / > ) ) ;