TypeScript says no overload matches a React call
No overload matches this call.Short answer
TS2769 means your arguments fit none of the signatures of a function or JSX prop. In React the cause is nearly always a type you gave: an event handler with the wrong event type, a useState value that does not match the state type, or a reducer action TypeScript cannot narrow. Read the last overload line of the error.
Fix it fast
1Find out which cause you have
Run the compiler and read the last overload block of the message; it names the exact argument and the type it expected.
npx tsc --noEmit2Match what you see, then jump to its fix
- 1
The error points at an onChange or onClick propThe event handler has the wrong event typeFix - 2
The error points at a call to the state setteruseState infers a narrower type than the values you setFix - 3
No overload matches this call on dispatch(...) or useReducer(...)useReducer cannot match the dispatched actionFix
- 1
What does the error look like?
No overload matches this call.
Cause 1 of 3
The event handler has the wrong event type
1Check
The React docs type input handlers with React.ChangeEvent<HTMLInputElement> and mouse handlers with a matching element type, and advise the generic React.SyntheticEvent when you are unsure. Hover the prop in your editor to see the expected type.
grep -rn "onChange=\|onClick=" src/ | head2Fix
Use the event type that matches the element.
function handleChange(event: React.ChangeEvent<HTMLInputElement>) {
setValue(event.currentTarget.value);
}
function handleClick(event: React.MouseEvent<HTMLButtonElement>) {
console.log(event.clientX);
}3Verify
Run the type checker.
npx tsc --noEmitConfirmed by react.dev
Cause 2 of 3
useState infers a narrower type than the values you set
1Check
useState infers its type from the first value. If the state starts as a string literal or an empty shape, later values of a wider type are rejected.
grep -rn "useState(" src/ | head2Fix
Give useState the full type, as the React docs do for unions.
type Status = "idle" | "loading" | "success" | "error";
const [status, setStatus] = useState<Status>("idle");3Verify
Run the type checker.
npx tsc --noEmitConfirmed by react.dev
Cause 3 of 3
useReducer cannot match the dispatched action
1Check
The docs type the action as a union with a type field, and give the reducer explicit State and Action parameters. An action object outside the union fits no overload.
grep -rn "useReducer\|dispatch(" src/ | head2Fix
Type the reducer's state and action, and dispatch only objects from the union.
type CounterAction =
| { type: "reset" }
| { type: "setCount"; value: number };
function reducer(state: State, action: CounterAction): State { /* ... */ }
dispatch({ type: "setCount", value: 3 });3Verify
Run the type checker.
npx tsc --noEmitConfirmed by react.dev
How do I stop it coming back?
- Let the editor show you the expected type of a prop before you write a handler.
- Type props, state and reducers explicitly at the boundary instead of leaning on inference.
- Keep @types/react in step with the React version.
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:
- TaxiDexMy own multi-tenant taxi dispatch SaaS: API, dispatcher portal, driver and passenger apps, and the servers underneath.
- QistLockA NestJS and React SaaS driving an Android Device Owner agent that locks financed phones when payments lapse.
- TaskvareA task and project-management suite: React on the web, Flutter on mobile, TypeScript underneath.
Related fixes
Web apps
TypeScript refuses JSX because the jsx option is not set
TS17004: Cannot use JSX unless the '--jsx' flag is provided.
TypeScript compiles JSX only when you name the file with a .tsx extension and enable the jsx compiler option.
2 causes, each with a fixWeb apps
TypeScript rejects a component that returns an array or other non-Element
Its return type 'Element[]' is not a valid JSX element.
TypeScript before 5.1 required every component to return JSX.Element or null, so arrays, strings and Promises were rejected even though React renders them.
2 causes, each with a fixWeb apps
ESLint says it cannot resolve a path to a module that does exist
Unable to resolve path to module 'react'. import/no-unresolved
import/no-unresolved fails when eslint-plugin-import cannot find the file or package on disk with its resolver.
4 causes, each with a fixWeb apps
ESLint reports no-unused-vars for React components and imports that are used
no-unused-vars reported for a component that is rendered as a JSX tag
ESLint's core no-unused-vars does not see variables used only as JSX tags, so a component imported and rendered as <Hello /> looks unused.
3 causes, each with a fixWeb apps
TypeScript rejects MUI Data Grid columns that set a type
A TypeScript error inside a column's renderCell callback
A columns array declared without a type is inferred with type as a plain string, which the Data Grid's column type union does not accept.
2 causes, each with a fixWeb apps
The renderInput prop stopped working on the MUI X DatePicker
The custom TextField (variant, size, helperText) is ignored
renderInput was removed from the MUI X date pickers in version 6.
3 causes, each with a fix