<aside> ๐ก
๋ชจ๋ ํจ์๋ ํ์ดํ ํจ์๋ก ์์ฑํ๋ค.
const sum = () => {};
</aside>
<aside> ๐ก
๋ณ์ ๋ฐ ํจ์๋ช ์ ์ฝ์ด๋ฅผ ์ง์ํ๋ค.
BAD : ย idx
arr
btn
/ ย GOOD : index
array
button
</aside>
<aside> ๐ก
๋ฐํ๊ฐ์ด boolean์ธ ๋ณ์์ ์ด๋ฆ์ is , has๋ก ์์ํ๋ค.
isNum
,ย hasNum
</aside>
<aside> ๐ก
์ปดํฌ๋ํธ์ย Props๋ย interface๋ก ์ ์ธํ๊ณ ย ์ปดํฌ๋ํธ ๋ช + Props๋ก ๋ช ๋ช ํ๋ค.
interface InputProps{}
</aside>
<aside> ๐ก
ํธ๋ค๋ฌ ํจ์๋ handle ์ ๋์ฌ + ์ด๋ฒคํธ ์ด๋ฆ์ ์ฌ์ฉํ๋ค. Prop์ผ๋ก ๋๊ธฐ๋ ์ด๋ฒคํธ ํธ๋ค๋ฌ๋ on ์ ๋์ฌ๋ฅผ ์ฌ์ฉํ๋ค.
<MyComponent onAlertClick={handleAlertClick} />
</aside>
<aside> ๐ก
๋ณต์ ๋๋ ๋ฐฐ์ด ๋ณ์์ ๊ฒฝ์ฐ ๋ณ์๋ช ์ ๋์ List๋ฅผ ๋ถ์ธ๋ค.
userList.map((user) โ {})
</aside>
<aside> ๐ก
API ํธ์ถ ํจ์๋ ๋ค์๊ณผ ๊ฐ์ ์ ๋์ฌ๋ฅผ ๋ถ์ธ๋ค.
GET
: get- const getUserData = () => {}
POST
: post- const postUserData = () => {}
PATCH
: patch- const patchUserData = () => {}
DELETE
: delete- const deleteUserData = () => {}
</aside><aside> ๐ก
์ฝ๋๋ Import
/ Interface(type)
/ main
/ export
์์ผ๋ก ์์ฑํ๋ค.
import ...
interface ...
const component = ({}) => {
}
export default Component
</aside>