TypeScript: error TS7031: Binding element 'name' implicitly has an 'any' type.
A destructured parameter has no type, so its elements default to any.
error TS7031: Binding element 'name' implicitly has an 'any' type.Binding element implicitly has an 'any' type. ts(7031)TS7031 Binding element 'x' implicitly has an 'any' typeerror TS7031 Meaning
Type the whole parameter: function Card({ name }: { name: string }) or ({ name }: Props). Common in React components, Express handlers, and event callbacks where context typing is missing.
Common causes
- Destructured props without a Props type
- Callback parameters without contextual typing
- Function declared before types exist
- JS-style code in TS
- Missing generic arguments
⚡ Quick fix
function Card({ title }: Props) {}- Define
interface Props { title: string } - Provide contextual types (
React.FC<Props>, typed handler)
Detailed fix by platform
TypeScript
export function Card({ title, onClick }: { title: string; onClick: () => void }) {}
How to diagnose
- Parameter — Typed?
- Props — Interface?
- Context — Provided?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- [Vue warn]: Invalid prop: type check failed Vue: [Vue warn]: Invalid prop: type check failed for prop "count". Expected Number with value 5, got String with value "5"
- [Vue warn]: Missing required prop Vue: [Vue warn]: Missing required prop: "title"
- Avoid mutating a prop directly Vue: [Vue warn]: Avoid mutating a prop directly since the value will be overwritten whenever the parent component re-renders
Most viewed in TypeScript
- TS2564 TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor
- TS2322 TS2322: Type 'X' is not assignable to type 'Y'
- TS2366: Function lacks ending return statement TypeScript: error TS2366: Function lacks ending return statement and return type does not include 'undefined'.
Other ways to find it
Where this error sits
Origin: On your device. Errors that are often confused with or caused by this one (click to open):
🧠 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.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 5 Nov 2026