Menu
Important: This documentation is about an older version. It's relevant only to the release noted, many of the features and functions have been updated or replaced. Please view the current version.
Enterprise
Open source
ReactUtils.renderOrCallToRender() function
ReactUtils.renderOrCallToRender() function
Given react node or function returns element accordingly
Signature
typescript
export declare function renderOrCallToRender<TProps = any>(itemToRender: ((props?: TProps) => React.ReactNode) | React.ReactNode, props?: TProps): React.ReactNode;Import
typescript
import { ReactUtils } from '@grafana/ui';
const { renderOrCallToRender } = ReactUtils;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
Was this page helpful?
Related resources from Grafana Labs
Additional helpful documentation, links, and articles:
Scroll for more