This is documentation for the next version of Grafana. For the latest stable release, go to the latest version.

API Reference@grafana/uirenderOrCallToRender

renderOrCallToRender() function

renderOrCallToRender() function

Given react node or function returns element accordingly

Signature

export declare function renderOrCallToRender<TProps = any>(itemToRender: ((props?: TProps) => React.ReactNode) | React.ReactNode, props?: TProps): React.ReactNode;

Import

import { renderOrCallToRender } from '@grafana/ui';

Parameters

Parameter Type Description
itemToRender ((props?: TProps) => React.ReactNode) | React.ReactNode
props TProps props to be passed to the function if item provided as such

Returns:

React.ReactNode