Warning: Received `true` for a non-boolean attribute `x`.
A boolean was passed to a DOM attribute that expects a string, or a custom prop leaked through to a DOM element.
Seen on:
React
Meaning
Custom props spread onto DOM elements (often via styled-components or {...props}) end up as invalid HTML attributes.
Common causes
- Spreading all props onto a DOM element
- styled-components passing custom props to the DOM
- Using a boolean for an attribute like data-* without converting
⚡ Quick fix
- Destructure custom props before spreading
- Use transient props ($active) in styled-components
- Convert to strings: attr={value ? 'true' : undefined}
Detailed fix by platform
React
const Button = styled.button\opacity: ${p => (p.$disabled ? 0.5 : 1)};\;
How to diagnose
- Attribute — Which prop is named?
- Source — Which element receives it?
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 2 Oct 2026