import React from 'react' ; import { isFunction } from '@utils/lang' ; export interface RenderPropFunction < Args = WhyAny [ 'GenericTemplateArgument' ] > { ( args ) : React . ReactNode ; } export const renderChild = < Args = WhyAny [ 'GenericTemplateArgument' ] > ( child , args ? ) => { if ( isFunction ( child ) ) { return child ( args ) ; } return child ; } ;