Function
convertRender
(
Component: PluginRender,
setComponents: React.Dispatch<
React.SetStateAction<Record<string, JSX.Element>>
>,
e: HTMLElement,
props: TanStackDevtoolsPluginProps,
)
Source from the content-addressed store, hash-verified
| 117 | } |
| 118 | |
| 119 | const convertRender = ( |
| 120 | Component: PluginRender, |
| 121 | setComponents: React.Dispatch< |
| 122 | React.SetStateAction<Record<string, JSX.Element>> |
| 123 | >, |
| 124 | e: HTMLElement, |
| 125 | props: TanStackDevtoolsPluginProps, |
| 126 | ) => { |
| 127 | const element = |
| 128 | typeof Component === 'function' ? Component(e, props) : Component |
| 129 | |
| 130 | setComponents((prev) => ({ |
| 131 | ...prev, |
| 132 | [e.getAttribute('id') as string]: element, |
| 133 | })) |
| 134 | } |
| 135 | |
| 136 | const convertTrigger = ( |
| 137 | Component: TriggerRender, |
Tested by
no test coverage detected