@grafana/ui
Version:
Grafana Components Library
12 lines (11 loc) • 549 B
TypeScript
import { ReactElement } from 'react';
import * as React from 'react';
/** Returns the ID value of the first, and only, child element */
export declare function getChildId(children: ReactElement): string | undefined;
/**
* Given react node or function returns element accordingly
*
* @param itemToRender
* @param props props to be passed to the function if item provided as such
*/
export declare function renderOrCallToRender<TProps = {}>(itemToRender: ((props: TProps) => React.ReactNode) | React.ReactNode, props?: TProps): React.ReactNode;