Maaz Zindani

Loading the index…

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

TypeScript says no overload matches a React call

ErrorNo 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.

  • Applies to TypeScript 5.x, React 19, @types/react 19
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Fix it fast

  1. 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 --noEmit
  2. 2Match what you see, then jump to its fix

    1. 1The error points at an onChange or onClick propThe event handler has the wrong event typeFix
    2. 2The error points at a call to the state setteruseState infers a narrower type than the values you setFix
    3. 3No overload matches this call on dispatch(...) or useReducer(...)useReducer cannot match the dispatched actionFix

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/ | head

2Fix

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 --noEmit

Confirmed by react.dev

Did this fix it?

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/ | head

2Fix

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 --noEmit

Confirmed by react.dev

Did this fix it?

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/ | head

2Fix

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 --noEmit

Confirmed by react.dev

Did this fix it?

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:

Related fixes

Web 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 fix

Next step

Want this handled for good?

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