fshiawnbkiuhu
@fshiawnbkiuhu
Reviews Written
-
Average Rating
-
Posts
Q&A
์ต์ ํ useMemo ์ ์ฉํ๊ณ ๋์, ์ญ์ ๋ฅผ ํ์์ ๊ฒฝ์ฐ ๋ํ๋๋ ์๋ฌ์ ๋๋ค.
์ฝคํฌ๋ํธ์ onRemove๊ฐ prop์ผ๋ก ์ ๋ฌ ๋๋์ง ํ์ธ ํ, ์ต์ ๋ํ๊ฒ ์ ๋ฌ๋ฐ๋๊ฑฐ๋ฉด์๋์ฒ๋ผ ์์ onRemove?.();ํน์ useCallback ๊ตฌ์กฐ์ด๋ฉดconst handleRemove = useCallback(() => {...onRemove?.();}, [onRemove]);์ด๋ ๊ฒ ํธ์ถํ๋ฉด ๋ ๊ฑฐ๊ฐ์์
- Likes
- 0
- Comments
- 4
- Viewcount
- 796
Q&A
๋น๋๊ธฐ ๋ฐฉ์์์ ์ฝ๋ฐฑํจ์ ์ฌ์ฉ ์ด์
์ถํ์ callback์ ํจ์์ ์ธ์๋ก ๋ฐ์ ์ฒ๋ฆฌํ ๊ฒฝ์ฐ, ์ ์์ ๋ฅผ ๋ ์ฌ๋ฆฌ๋ฉฐ ๋์๋ฐฉ์์ ์ดํดํ๋๋ฐ ๋์์ด ๋์ง ์์๊น์?
- Likes
- 0
- Comments
- 3
- Viewcount
- 741
Q&A
useEffect์ ์์น ์กฐ๊ฑด์ ์ ๋ชจ๋ฅด๊ฒ ์ต๋๋ค.
https://legacy.reactjs.org/docs/hooks-rules.html#:~:text=Only%20Call%20Hooks,depth%20below.)
- Likes
- 1
- Comments
- 3
- Viewcount
- 790
Q&A
async return ์๋ฃํ์ด Promise์ธ ์ค์ง์ ๋ํ ์ง๋ฌธ
async๋ก ์ ์ธ๋ ํจ์์ ๋ฐํํ์ promise์๋๊ฐ์?ํ๋ก๋ฏธ์ค๊ฐ ๋ง์์.์คํ ํ๋ฆ์ main ํจ์๋ถํฐ ์ฒ์ฒํ ๋ณด๋ฉด1. async main() ํจ์ ์คํ2. const res = await helloAsync(); ๊ตฌ๋ฌธ ์คํ์ด ๋ helloAsyncํจ์๋ async function์ด๊ธฐ ๋๋ฌธ์ promise๋ฅผ ๋ฐํํ๋๊ฒ ๋ง์ง๋ง await ๋๊ฒ ๋๋ฉด promise ๊ฐ resolve ํน์ reject๋ ๋ ๊น์ง ๊ธฐ๋ค๋ ค์. ๊ทธ๋ฆฌ๊ณ resolve๊ฐ ๋๋ค๋ฉด res๋ณ์์ resolve๋ ๊ฐ์ด ํ ๋น๋๊ฒ ๋์ด์ helloAsyncํจ์๊ฐ ๋ฆฌํดํ๋ ๊ฐ์ธ "hello async" ๋ฌธ์์ด์ ์ฝ์๋ก ์ฐ์ ์ ์๊ฒ๋์.
- Likes
- 0
- Comments
- 2
- Viewcount
- 704
Q&A
Object is not iterable
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/is_not_iterablePromisse.all ์ด๋ TypedArray.from ํจ์์ ์ธ์๋ ๋น๊ตฌ์กฐํ ํ ๋น๋๋ ๋ฐฐ์ด๊ณผ ๊ฐ์ด itertableํ ๊ฐ์ฒด๊ฐ ์ฌ์ฉ๋ผ์ผํ๋๋ฐ ์ค์ ๋ก๋ iterableํ ๊ฐ์ฒด๊ฐ ์๋์ฌ์ ๋ฐ์ํ๋ ๊ฒ ๊ฐ์์
- Likes
- 0
- Comments
- 4
- Viewcount
- 1.2K




