ReactUtils.renderOrCallToRender() function

ReactUtils.renderOrCallToRender() function

Given react node or function returns element accordingly

Signature

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

Import

  1. import { ReactUtils } from '@grafana/ui';
  2. const { renderOrCallToRender } = ReactUtils;

Parameters

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

Returns:

React.ReactNode