Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong return type in docs for useMutation #475

Closed
nicoqh opened this issue May 9, 2020 · 0 comments
Closed

Wrong return type in docs for useMutation #475

nicoqh opened this issue May 9, 2020 · 0 comments
Labels

Comments

@nicoqh
Copy link

nicoqh commented May 9, 2020

According to the docs, the error returned by useMutation can either be null or Error.

However, it can also be undefined when mutationReducer returns a new state object without the error property. types/test.ts suggests that this is intended.

If so, the docs should say null | undefined | Error.

I'm opening an issue instead of a PR for the docs, in case you want to change the reducer instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants