Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4072 pages
Next.js and React

TypeScript: property does not exist on type IntrinsicAttributes in a React component

ErrorProperty 'XXX' does not exist on type 'IntrinsicAttributes & ...'

Short answer

TypeScript checks the props you write in JSX against the component's props type. The error means you passed a prop that type does not list. Add the prop to the component's props interface, fix a misspelled name, or add an index signature if the component really accepts arbitrary extra props.

  • Applies to TypeScript 5.9, React 19, Node.js 22
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 1Find out which cause you have

    Open the component's definition and read its props type. Compare it with the props you pass at the place the error points to.

    npx tsc --noEmit
  2. 2Match what you see, then jump to its fix

    1. 1The error names a prop that you pass on purpose.The prop is not declared in the component's props typeFix
    2. 2TypeScript adds Did you mean ...? to the message, or another prop in the type looks like the one you wrote.The prop name is misspelled or was renamedFix
    3. 3Many different names are passed through, and listing each one is not realistic.The component really takes extra props that are not known in advanceFix

What does the error look like?

  • Property 'XXX' does not exist on type 'IntrinsicAttributes & ...'
  • Object literal may only specify known properties

Cause 1 of 3

The prop is not declared in the component's props type

1Check

Look at the interface or type used for the component's parameter.

grep -n "interface .*Props\|type .*Props" src/components/MyButton.tsx

2Fix

Add the prop to the interface, and use that interface on the function's parameter.

interface MyButtonProps {
  title: string;
  disabled: boolean;
}

function MyButton({ title, disabled }: MyButtonProps) {
  return <button disabled={disabled}>{title}</button>;
}

3Verify

Run the type check. The error at the call site should be gone.

npx tsc --noEmit

Confirmed by react.dev

Did this fix it?

Cause 2 of 3

The prop name is misspelled or was renamed

1Check

TypeScript treats object literals with unknown properties as a probable bug. Compare spelling and case with the declared names.

grep -rn "<MyButton" src/

2Fix

Use the declared name at the call site; rename the declaration only if the new name is the better one, and then update every user.

// declared: title
<MyButton title="Save" disabled={false} />

3Verify

Run the type check again.

npx tsc --noEmit

Confirmed by typescriptlang.org

Did this fix it?

Cause 3 of 3

The component really takes extra props that are not known in advance

1Check

Confirm that the component forwards them somewhere useful, and not just ignores them.

grep -n "\.\.\.rest\|\.\.\.props" src/components/MyButton.tsx

2Fix

Add a string index signature to the props type. Known properties must still match their declared types.

interface MyButtonProps {
  title: string;
  [propName: string]: unknown;
}

3Verify

Run the type check. Unknown names pass, a wrong type for title still fails.

npx tsc --noEmit

Confirmed by typescriptlang.org

Did this fix it?

How do I stop it coming back?

  • Declare a named props interface for every component, and export it next to the component.
  • Run tsc --noEmit in CI so a prop change breaks the build at the call site.
  • Use your editor's rename command when changing a prop name, so all usages change together.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine built on the same technologies:

Related fixes

Web apps

TypeScript says a JavaScript module implicitly has an any type

Could not find a declaration file for module 'react-materialize'. 'path/to/module-name.js' implicitly has an 'any' type.

TypeScript found the JavaScript file but no types for it, and noImplicitAny turns that into an error.

2 causes, each with a fix

Web apps

TypeScript says a function lacks an ending return statement

A function with a declared return type, such as Promise<string>, shows the red line under the type

TypeScript found a way for your function to reach its closing brace without returning a value, while the declared return type does not allow undefined.

4 causes, each with a fix

Web apps

tsconfig rejects allowImportingTsExtensions

An error that allowImportingTsExtensions needs noEmit or emitDeclarationOnly

allowImportingTsExtensions lets files import each other with .ts or .tsx extensions, and TypeScript only allows it together with noEmit or emitDeclarationOnly.

2 causes, each with a fix

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.