Slack Clone Coding [Real-time Chat with React]
Let's start serious React web development by creating it following the Slack service! From sign-up, login, room creation, to real-time chat!
2,892 learners
Level Intermediate
Course period Unlimited
fetcher grammar related
I'm sharing this because so many people are making this mistake. I get asked this question two or three times a month.
In @utils/fetcher.ts
(...) => ( axios.get(...) ) instead
(...) => { axios.get(...) }
There are many people who do this. These two are completely different. They produce completely different results.
In conclusion, you should do ( axios.get(...) ).
This is syntactically equivalent to { return axios.get(...) }.
Please add return or wrap it with ( ) instead of { }.
If you don't understand why, quickly study the arrow function syntax again.




