MCPcopy Create free account
hub / github.com/TanStack/devtools / createReactPlugin

Function createReactPlugin

packages/devtools-utils/src/react/plugin.tsx:5–29  ·  view source on GitHub ↗
({
  Component,
  ...config
}: {
  name: string
  id?: string
  defaultOpen?: boolean
  Component: (props: DevtoolsPanelProps) => JSX.Element
})

Source from the content-addressed store, hash-verified

3import type { TanStackDevtoolsPluginProps } from '@tanstack/devtools'
4
5export function createReactPlugin({
6 Component,
7 ...config
8}: {
9 name: string
10 id?: string
11 defaultOpen?: boolean
12 Component: (props: DevtoolsPanelProps) => JSX.Element
13}) {
14 function Plugin() {
15 return {
16 ...config,
17 render: (_el: HTMLElement, props: TanStackDevtoolsPluginProps) => (
18 <Component {...props} />
19 ),
20 }
21 }
22 function NoOpPlugin() {
23 return {
24 ...config,
25 render: (_el: HTMLElement, _props: TanStackDevtoolsPluginProps) => <></>,
26 }
27 }
28 return [Plugin, NoOpPlugin] as const
29}

Callers 2

plugin.tsFile · 0.90
plugin.tsFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected