import React, { useEffect, useRef } from 'react'; import { GenericContentItemProps } from './types'; const GenericContentItem: React.FC = (props) => { const { renderFunction, width, } = props; const elementRef = useRef(null); useEffect(() => { if (elementRef.current && renderFunction) { renderFunction(elementRef.current); } }, [elementRef]); const style: React.CSSProperties = { height: '100%', overflow: 'hidden', }; if (width) { style.width = width; } return (
); }; export default GenericContentItem;