์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
1 | ||||||
2 | 3 | 4 | 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 | 13 | 14 | 15 |
16 | 17 | 18 | 19 | 20 | 21 | 22 |
23 | 24 | 25 | 26 | 27 | 28 |
- js
- ๊ฒ์
- database
- prj
- webpack
- ajax
- mysql
- await
- ๋๊ธฐ
- Import
- Project
- async
- addEventListener
- ์ฐธ๊ณ ๋ธ๋ก๊ทธ
- JS #ํ๋ก์ ํธ
- object
- sql
- callback
- ๋น๋๊ธฐ
- setTimeout()
- Porject
- execCommand
- ํผํ
- https://m.blog.naver.com/tt2t2am1118/221010125300
- json
- eport
- promise
- db
- slow and steady
- https://youtube.com/playlist?list=PLuHgQVnccGMA5836CvWfieEQy0T0ov6Jh&si=FTaYv8m21EhO-A2K
- Today
- Total
๋ชฉ๋ก๐ป๊ฐ๋ฐ ๋ ธํธ (21)
C-log
์ง๋๋ฒ ํฌ์คํ ์์ ์ง์ ํ๋ ๋ฌธ์ ์ ํ ๊ด๋ จํด ๋ณด์ํ ๋ถ๋ถ์ ์ฝ๋๋ค์ ๋ฆฌ๋ทฐํ๋ ค๊ณ ํ๋ค. ๋จผ์ ๋ฌธ์ ๋ฅผ ๊ฐ์ ธ์ค๋ useEffect๋ถ๋ถ์ ๋ณด๋ฉด ์๋์ ๊ฐ๋ค.(branch/7) useEffect(() => { fetch('http://localhost:3001/sample') .then(res => res.json()) .then((data) => { // ๋ฐ์ดํฐ๋ฅผ ๊ฐ์ ธ์จ ํ, ์ ํ๋ ๊ฐ์๋งํผ ์๋ฅด๊ณ ์์ const limitedData = data.slice(0, limit); const shuffledData = shuffleArray(limitedData); setData(shuffledData); }) .catch((error) => { console.error("Error fetching data:", ..
๋ฒํผ์ ๋๋ ์ ๋ ๋ฌธ์ ๊ฐ ์์ผ ์ ์๋ ๊ธฐ๋ฅ์ ๊ตฌํํ๊ณ ์ ํ๋ค. ์ฐ์ ๋๋ค์ผ๋ก ๋ฌธ์ ๋ฅผ ์๊ธฐ ์ํด์๋ ํผ์ ์์ด์ธ ์๊ณ ๋ฆฌ์ฆ์ ์ฌ์ฉํด์ผ ํ๋ค. ์ฝ๋๋ ์๋์ ๊ฐ๋ค. // shuffleArray(Fisher-Yates) ์๊ณ ๋ฆฌ์ฆ์ ์ฌ์ฉํ์ฌ ๋ฐฐ์ด์ ์๋ ํจ์ function shuffleArray(array) { for (let i = array.length - 1; i > 0; i--) { const j = Math.floor(Math.random() * (i + 1)); [array[i], array[j]] = [array[j], array[i]]; } return array; } ์ฃผ์ด์ง ๋ฐฐ์ด์ ๊ธธ์ด๋ฅผ ๊ธฐ์ค์ผ๋ก ์ญ์์ผ๋ก ๋ฐ๋ณตํ๋ฉด์ ๊ฐ ์ธ๋ฑ์ค์ ๋๋ค์ผ๋ก ์ ํ๋ ์ธ๋ฑ์ค๋ฅผ ๊ตํํ์ฌ ๋ฐฐ์ด์ ์๋๋ค. ์ด ๊ณผ์ ์ ํตํด..
๋งํฌ๋ค์ด์ ์ด์ฉํด์ ์ํ์ง์ ์ด๋ฏธ์ง์ ์ํ ์๋ฃ๋ค์ ๋ถ๋ฌ ์ฌ ์ ์๋ ๋ฐฉ๋ฒ๋ค์ ๋ชจ์ํ๋ค ๋งํฌ๋ค์ด ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ด์ฉํ๊ณ ์ ํ๋ค. ์์๋ก ์๋์ ๊ฐ์ ์ ๋ ฌ๋ ๋ชจ์ต์ ๊ตฌํํ๋ ค๊ณ ํ๋ค. ์ผ์ชฝ ํด๋น ์ ๋ ฌ๋ ๋ชจ์ต์ ๋ฆฌ์กํธ์์ ๋งํฌ๋ค์ด์ด ์๋ css๋ก ๊ตฌํํ ๊ฒ์ด๋ค. ์ค๋ฅธ์ชฝ์ ๋งํฌ๋ค์ด๊ณผ Html๊ณผ ํผ์ฉํด์ css๋ก ๊ตฌํํ ๊ฒ์ด๋ค. ์ด๋ฌํ ์ ๋ ฌ์ ๋งํฌ๋ค์ด ๋ผ์ด๋ธ๋ฌ๋ฅผ ํ์ฉํด์ ๊ตฌํํ๋ฉด ์ข๊ฒ ๋ค๊ณ ์๊ฐํ๋ค. ๋งํฌ๋ค์ด ๋ผ์ด๋ธ๋ฌ๋ฆฌ ์ค ๊ฐ์ฅ ๋ง์ด ์ฌ์ฉํ๊ณ ๋ง์ ์๋ฃ๋ฅผ ๊ฐ์ง๊ณ ์๋ react-markdown์ ์ฌ์ฉํ๋ค. ๊ฐ๋จํ ์ฌ์ฉ ์์๋ ์๋์ ๊ฐ๋ค. import ReactMarkdown from "react-markdown"; const markdown = ` # Heading 1 This is a **bold** text a..
[FE] json-server๋ฅผ ํตํด ์์ API๋ฅผ ๊ฐ์ง๊ณ ๋ฌธ์ ๋ค์ ์ถ๋ ฅํ๋ค. by 4BFC · Pull Request #4 · 4BFC/sample_Capstone ํ์ธ ์ json-server ์ค์น ์๋ง github.com ๋๋ง์ ์ํ์ง๋ฅผ ํธ์งํ ์ ์๋ ํ์ด์ง๋ฅผ ์ ์ ์ค์ด๋ค. ๋ฐฑ์๋์์ ์ ์ํ sample jsonํ์ผ์ ๊ฐ์ง๊ณ ์ํ์ง์ ๋ค์ด๊ฐ ๋ฌธ์ ๋ค์ ํธ์ถํด ๋ณผ ๊ฒ์ด๋ค. API๋ฅผ ๋ถ๋ฌ์ค๊ธฐ ์ํด์ ์ฐ์ fetch์ useEffect๋ฅผ ์์์ผํ๊ณ ์ด๋ฅผ ํ์ฉํด์ ์ฝ๋๋ฅผ ์์ฑํ ๊ฒ์ด๋ค. ์์ง API๊ฐ ์ ์์ผ๋ก ๋ฐฐํฌ๊ฐ ๋์ง ์์๊ธฐ ๋๋ฌธ์ ์์๋ก ์ฌ์ฉํ ์ ์๋ json-server๋ฅผ ๊ฐ์ง๊ณ ์์์ฃผ์๋ก API๋ฅผ ํธ์ถํ ๊ฒ์ด๋ค. ๋ฌธ์ ๋ฅผ ๋ถ๋ฌ์ค๋ ๊ฐ์ ์ ํ์ ๋ค์ ์ด์์ ๋ค๋ฃจ์ด ๋ณผ ๊ฒ์ด๋ค. ์ฐ์ ์๋ ์ฝ๋๋ฅผ ์ดํด..