Skip to content

fix(devtools)!: follow the TanStack Devtools theme in the panel - #75

Merged
JasonPaff merged 1 commit into
mainfrom
jasonpaff/par-120-devtools-panel-always-renders-light-the-tanstack-shell-never
Oct 3, 2026
Merged

JasonPaff merged 1 commit into
mainfrom
jasonpaff/par-120-devtools-panel-always-renders-light-the-tanstack-shell-never

Conversation

@JasonPaff

Copy link
Copy Markdown
Owner

Found in the PAR-3 trial on the ATK web app. The Paramour panel rendered white inside a dark TanStack Devtools shell. TanStack's setting was theme: "dark" and the app's <html> was dark, but .pmr-root had data-theme="light".

Cause

paramourDevtoolsPlugin() returned render: <ParamourDevtoolsPanel />. In @tanstack/react-devtools (checked 0.10.0, 0.10.8 and 0.10.13), convertRender calls render(el, props) only when render is a function, and uses an element as-is. Core 0.11–0.15 calls it with { theme, devtoolsOpen }. So the panel never received theme and fell back to "light". The docs said the shell "clones the rendered element and injects theme", which no supported version does.

Change

  • render is now (_el, { theme }) => <ParamourDevtoolsPanel theme={theme} />. Every shell in the >=0.10.0 peer range calls a function render with the theme.
  • Breaking (types), decided for the rc: ParamourDevtoolsPluginEntry.render changes from ReactElement to (el: HTMLElement, props: { readonly theme: "dark" | "light" }) => ReactElement. <TanStackDevtools plugins={[paramourDevtoolsPlugin()]} /> is unchanged. Only code that reads entry.render as an element is affected. The changeset is major, which stays at 1.0.0-rc.2 in pre mode (checked with changeset status).
  • The devtools reference, the devtools guide and the panel prop comment no longer claim injection.

Verification

  • New theme.test.tsx case: the entry's render, called as the shell calls it, mounts the panel with that theme and flips it without remounting. It fails without the fix with entry.render is not a function.
  • public-api.tst.tsx pins the new render type and still checks assignability to the real shell's plugins type. test:types:devtools passes on TS 5.4 and current.
  • pnpm test packages/devtools: 86 passed. Typecheck, lint and the examples' typecheck are clean.
  • In the browser, examples/basic on the local build with the real TanStack shell: the shell set to dark gives data-theme="dark", and set to light gives "light". On /product/42?page=2&q=cable the panel shows the /app hooks' params and search decode, and the console is clean.

Fixes PAR-120

🤖 Generated with Claude Code

paramourDevtoolsPlugin() returned render as a plain element. The TanStack
shell passes its theme only to function renders and renders elements as-is,
so the panel never received `theme` and always rendered light. The docs
claimed the shell cloned the element and injected the theme, which no
supported shell version does.

render is now (el, { theme }) => <ParamourDevtoolsPanel theme={theme} />.
Every shell the >=0.10.0 peer range allows calls a function render with
{ theme, devtoolsOpen }.

BREAKING CHANGE: ParamourDevtoolsPluginEntry.render changes from
ReactElement to (el: HTMLElement, props: { readonly theme: "dark" | "light" })
=> ReactElement. Passing the entry to <TanStackDevtools plugins={...} /> is
unchanged.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
@vercel

vercel Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
paramour-docs Ready Ready Preview Oct 3, 2026 2:22am UTC

@JasonPaff
JasonPaff merged commit 96bb9a0 into main Oct 3, 2026
13 checks passed
@JasonPaff
JasonPaff deleted the jasonpaff/par-120-devtools-panel-always-renders-light-the-tanstack-shell-never branch October 3, 2026 02:25

This branch was successfully deployed

1 active deployment
Preview — d99a45d1 Deployed Oct 3, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant