import { isFunction } from 'lodash'; import type React from 'react'; /** * A helper for rendering "render prop" contents * * Supports: * - Render Function * - ReactNode (JSX.Element or string) */ export function renderContent(Content: React.ReactNode | React.FunctionComponent, props: T): React.ReactNode { if (isFunction(Content)) { const renderFunction = Content; return renderFunction(props); } return Content; }