Skip to content

TContext is not inferred from onMutate #1607

@jansedlon

Description

@jansedlon

Describe the bug
Type of TContext in onError is not inferred from returned value of onMutate

To Reproduce
Steps to reproduce the behavior:
Go to https://codesandbox.io/s/gracious-newton-crlx9?file=/src/App.tsx

Expected behavior
TContext to be inferred from onMutate return value

React-Query

  • Version: 3.5.11

Additional context
I'm not sure if there's something that I'm missing but the provided CodeSandbox should be almost the same as the one from documentation.. Optimistic Updates with Typescript. In React-Query's codesandbox it is inferred, in my code it's not.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions