The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
grafana/docs/sources/packages_api/ui/renderorcalltorender.md

37 lines
1.1 KiB

+++
# -----------------------------------------------------------------------
# Do not edit this file. It is automatically generated by API Documenter.
# -----------------------------------------------------------------------
title = "renderOrCallToRender"
keywords = ["grafana","documentation","sdk","@grafana/ui"]
type = "docs"
+++
## renderOrCallToRender() function
### renderOrCallToRender() function
Given react node or function returns element accordingly
<b>Signature</b>
```typescript
export declare function renderOrCallToRender<TProps = any>(itemToRender: ((props?: TProps) => React.ReactNode) | React.ReactNode, props?: TProps): React.ReactNode;
```
<b>Import</b>
```typescript
import { renderOrCallToRender } from '@grafana/ui';
```
<b>Parameters</b>
| Parameter | Type | Description |
| --- | --- | --- |
| itemToRender | <code>((props?: TProps) =&gt; React.ReactNode) &#124; React.ReactNode</code> | |
| props | <code>TProps</code> | props to be passed to the function if item provided as such |
<b>Returns:</b>
`React.ReactNode`