강의

멘토링

커뮤니티

BEST
Programming

/

Front-end

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!

(4.8) 97 reviews

2,892 learners

Level Intermediate

Course period Unlimited

  • zerocho
Clone Coding
Clone Coding
React
React
TypeScript
TypeScript
Webpack
Webpack
Babel
Babel
Clone Coding
Clone Coding
React
React
TypeScript
TypeScript
Webpack
Webpack
Babel
Babel

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.

Comment