Skip to content

Conversation

@noor-codes
Copy link
Contributor

Return Statement

I know everyone loves the one-liner code. It looks awesome!

But in this certain case, I thought newTodo is the second argument to useMutation hook here useMutation(newTodo => axios.post('/todos', newTodo)) which was very confusing for me when I tried to code and it didn't work. It took me a very long time to notice that small detail.

I think the return statement will drastically remove that confusion.

I know everyone loves the one-liner code. It looks awesome!

But in this certain case, I thought newTodo is the second argument to useMutation hook which was very confusing for me when I tried to code and it didn't work. It took me a very long time to notice that small detail.

 I I think the return statement will drastically remove that confusion. `useMutation(newTodo => axios.post('/todos', newTodo))`
@vercel
Copy link

vercel bot commented Sep 23, 2021

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/tannerlinsley/react-query/Cq98NAumhvGbfeQr6YML35691sgt
✅ Preview: https://react-query-git-fork-noor-codes-patch-1-tannerlinsley.vercel.app

@codesandbox-ci
Copy link

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 7ad3678:

Sandbox Source
tannerlinsley/react-query: basic Configuration
tannerlinsley/react-query: basic-typescript Configuration

@noor-codes
Copy link
Contributor Author

Before:
Screen Capture_select-area_20210924015932

After:
Screen Capture_select-area_20210924015849

@Sugaml
Copy link

Sugaml commented Sep 24, 2021 via email

@TkDodo TkDodo merged commit a53f632 into TanStack:master Sep 24, 2021
@noor-codes noor-codes deleted the patch-1 branch September 24, 2021 19:18
@tannerlinsley
Copy link
Member

🎉 This PR is included in version 3.24.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants