mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
37 lines
1.1 KiB
Markdown
37 lines
1.1 KiB
Markdown
|
+++
|
||
|
# -----------------------------------------------------------------------
|
||
|
# 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) => React.ReactNode) | React.ReactNode</code> | |
|
||
|
| props | <code>TProps</code> | props to be passed to the function if item provided as such |
|
||
|
|
||
|
<b>Returns:</b>
|
||
|
|
||
|
`React.ReactNode`
|
||
|
|