Describe the bug
In development, opening a document list whose pane header shows a single create button logs two styled-components warnings:
styled-components: it looks like an unknown prop "intent" is being sent through to the DOM, which will likely trigger a React console error. […]
styled-components: it looks like an unknown prop "params" is being sent through to the DOM, which will likely trigger a React console error. […]
On the first render the button is an anchor that carries both props as attributes:
<a data-testid="action-intent-button" role="link" aria-disabled="true" intent="create" params="[object Object]">
Once the template permissions resolve, it is replaced by the regular IntentLink (href="/intent/create/template=author;type=author/", no intent or params attribute), so the leak lasts only for the loading render.
The disabled branch of the core IntentButton spreads every prop into the anchor (IntentButton.tsx#L14-L15):
return props.disabled ? (
<Button {...props} as="a" role="link" aria-disabled="true" />
PaneHeaderCreateButton passes the intent into it as spread props (#L123), and the button is disabled while useTemplatePermissions is still loading (const disabled = !permissions?.granted, #L112). This started with #14226, which replaced the structure-local IntentButton (it destructured intent before spreading the rest) with the core one.
To Reproduce
A Studio with nothing but the structure tool is enough:
// sanity.config.ts
import {defineConfig} from 'sanity'
import {structureTool} from 'sanity/structure'
export default defineConfig({
projectId: '<projectId>',
dataset: '<dataset>',
plugins: [structureTool()],
schema: {
types: [{name: 'author', type: 'document', fields: [{name: 'name', type: 'string'}]}],
},
})
- Install
sanity@6.15.0, react@19.3.0, react-dom@19.3.0 and styled-components@6.5.3, then run sanity dev.
- Open
/structure/author.
- See both warnings in the browser console.
With the same setup on sanity@6.9.2 the warnings do not appear. The code is unchanged in 6.16.0 and on main (6619338).
Expected behavior
No unknown-prop warnings: the disabled create button renders its anchor without the IntentLink-only props such as intent and params.
Which versions of Sanity are you using?
@sanity/cli (global) 8.12.0 (latest: 8.13.0)
sanity 6.15.0 (latest: 6.16.0)
What operating system are you using?
macOS 26.6.2, Chrome 154
Which versions of Node.js / npm are you running?
Node.js 24.20.0, pnpm 11.27.1
Additional context
Reproduced both in a Next.js 16.3 app with an embedded Studio (next-sanity 13.3.4) and in the standalone setup above.
Describe the bug
In development, opening a document list whose pane header shows a single create button logs two styled-components warnings:
On the first render the button is an anchor that carries both props as attributes:
Once the template permissions resolve, it is replaced by the regular
IntentLink(href="/intent/create/template=author;type=author/", nointentorparamsattribute), so the leak lasts only for the loading render.The disabled branch of the core
IntentButtonspreads every prop into the anchor (IntentButton.tsx#L14-L15):PaneHeaderCreateButtonpasses the intent into it as spread props (#L123), and the button is disabled whileuseTemplatePermissionsis still loading (const disabled = !permissions?.granted,#L112). This started with #14226, which replaced the structure-localIntentButton(it destructuredintentbefore spreading the rest) with the core one.To Reproduce
A Studio with nothing but the structure tool is enough:
sanity@6.15.0,react@19.3.0,react-dom@19.3.0andstyled-components@6.5.3, then runsanity dev./structure/author.With the same setup on
sanity@6.9.2the warnings do not appear. The code is unchanged in6.16.0and onmain(6619338).Expected behavior
No unknown-prop warnings: the disabled create button renders its anchor without the
IntentLink-only props such asintentandparams.Which versions of Sanity are you using?
What operating system are you using?
macOS 26.6.2, Chrome 154
Which versions of Node.js / npm are you running?
Node.js 24.20.0, pnpm 11.27.1
Additional context
Reproduced both in a Next.js 16.3 app with an embedded Studio (
next-sanity13.3.4) and in the standalone setup above.