์ผ | ์ | ํ | ์ | ๋ชฉ | ๊ธ | ํ |
---|---|---|---|---|---|---|
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 | 29 | 30 |
- js
- ๋ฐฑ์ค 2108 nodejs
- suspense ๋น๋๊ธฐ
- ์ฌ์ฉ์ฑ ๊ฐ์
- ์๋ฐ์คํฌ๋ฆฝํธ ์ค์ฝํ
- ๋ฐฑ์ค 1339๋ฒ nodejs
- ์ต์ ๋์ฒด์ด๋
- ํ๋ก๊ทธ๋๋จธ์ค ๊ฑฐ๋ฆฌ๋๊ธฐ ํ์ธํ๊ธฐ
- suspense ๋ณ๋ชฉํ์
- TypeError: createContext only works in Client Components. Add the "use client" directive at the top of the file to use it. Read more:
- ๊ตฌ๋ฆํค ์ฑ๋ฆฐ์ง
- emotion RSC
- ๋ฐฑ์ค 2108 ์๋ฐ์คํฌ๋ฆฝํธ
- ๋ฐฑ์ค 1339๋ฒ ์๋ฐ์คํฌ๋ฆฝํธ
- ๊ตฌ๋ฆํค
- suspense react-query
- js ์ค์ฝํ
- app router emotion
- ์นด์นด์ค ์ฝํ
- ์ค์ฝํ
- ์๋ฐ์คํฌ๋ฆฝํธ ๋ฌธ์์ด ์์ถ
- emtion app router
- ๋ฆฌ์กํธ์ฟผ๋ฆฌ suspense
- ํ๋ก๊ทธ๋๋จธ์ค ๋ฌธ์์ด ์์ถ
- js ๊ฑฐ๋ฆฌ๋๊ธฐ ํ์ธํ๊ธฐ
- suspense ๋์์๋ฆฌ
- js ๋ฌธ์์ด ์์ถ
- ๊ตฌ๋ฆํค ์ฑ๋ฆฐ์ง ํ๊ณ
- next13 emotion
- ๋ฐฑ์ค 1339๋ฒ js
- Today
- Total
๋ชฉ๋ก๐งโ๐ป Web (34)
Lennon FE
Next13์ app router ๋ฐฉ์์์ ํ์ฌ Emotion์ ๊ณต์์ ์ผ๋ก ์ง์ํด์ฃผ์ง ์๋๋ค.๐ฅฒ ๊ทธ๋ ์ง๋ง Project์์ Emotion lib๋ฅผ ์ฌ์ฉํ๊ณ , css์์ฑ์ ์ฌ์ฉํ๊ณ , app router์ RSC๋ฅผ ์ฌ์ฉํ๊ณ ์ถ์ ์ฌ๋๋ค์ด ์์๊น ๋ด(๋ณธ์ธ ํฌํจ!) ๋ฐฉ๋ฒ์ ์๋ ค์ฃผ๋ คํ๋ค. ๋ค๋ค ์๋ค์ํผ Emotion์ css ์์ฑ์ ์ฌ์ฉํ๋ ค๋ฉด tsconfig.json์ "jsxImportSource": "@emotion/react", ์์ ๊ฐ์ ์์ฑ์ ๋ฃ์ด์ผ ํ๋ค. ๊ทธ๋ฌ๋ฉด ๋ชจ๋ ํ๊ทธ์ css๋ฅผ ๋ฃ์ ์ ์์ด ์๋์ฒ๋ผ ์์ฑํ ์ ์๊ฒ ๋๋ค. import { css } from '@emotion/react'; ๊ทธ๋ ์ง๋ง tsconfig์ "jsxImportSource": "@emotion/react", ์ ์์ฑ์ ๊ฐ์ง..

Next.js๋ฅผ ํฌํจํ React ํ๋ก์ ํธ์์ Cypress๋ก e2e๋ฅผ ๊ตฌํํด ๋ด ์๋ค. ํ๋ก์ ํธ์ Cypress๋ฅผ ์ค์นํด ์ค๋๋ค. $ yarn add cypress --dev or $ npm install cypress --save-dev Package.json์ ๊ฐ์ ์คํฌ๋ฆฝํธ๋ฅผ ์ถ๊ฐํด ์ค๋๋ค. "scripts": { ..., "test": "cypress open", "cy:run": "cypress run" }, ํฐ๋ฏธ๋์์ ๋ช ๋ น์ด๋ฅผ ์์ฑํด ๋ด ์๋ค $ yarn test or $ npm run test ๊ทธ๋ผ ์๋์ ๊ฐ์ ํ๋ก๊ทธ๋จ์ด ์ผ์ง ๊ฒ๋๋ค! ์ฐ๋ฆฌ๋ e2e๋ฅผ ๊ตฌํํ ๊ฒ์ด๋๊น ์ฒซ ๋ฒ์งธ๋ฅผ ์ ํํ๊ณ ํ์ผ์ ์์ฑํด ์ค๋ค๋ ๊ฑฐ์ ๋์ํ๊ณ ๋์ด๊ฐ๋๋ค. ์ ๊ธฐ์ค Electron์ด ํธํด์ ์ ํํ์ฌ Start๋ฅผ ๋๋ฆ ๋..
๋ฆฌ์กํธ๋ฅผ ์ฌ์ฉํด ์ฝ๋๋ฅผ ์์ฑํ๋ค๋ณด๋ฉด ์๋ฒํต์ ๋ฐ ์ปดํฌ๋ํธ ๋ผ์ดํ ์ฌ์ดํด ์ฐจ์ด์ ๋ฐ๋ผ null, undefined๋ฅผ ๋ฐํํด ๊ฐ๋ ์ค๋ฅ๊ฐ ๋ฐ์ํ๊ณค ํ๋ค. ์ด๋ ๊ทธ๋๋ ์น์ ํ๊ฒ ์ค๋ฅ ์ฝ๋๋ก ์๋ ค์ฃผ๊ธฐ์ ํด๊ฒฐํ๊ธด ์ฌ์ธ ์ ์์ง๋ง, ์กด์ฌ ๋๋ ์กด์ฌํ์ง ์๋ ์์์ ๋ฉ์๋๋ค์ ๋ํด ์์ ํ๊ฒ ์ ๊ทผํ ์ ์๋๋ก ๋์์ฃผ๋ ์ต์ ๋ ์ฒด์ด๋ ์ฐ์ฐ์๋ฅผ ํตํด ๋ ์ฝ๊ฒ ํด๊ฒฐํ ์ ์๋ค. ์๋ ์ฝ๋์์ span์์ text๊ฐ์ด ๋ช์ด ๋์ฌ์ง ์์ํด๋ณด์. import React from 'react' const getNonEmptyCategories = (catrgories) => ( categories.filter((category) => category.items > 0); ) // categories = [ {items: 5, id..
Array๋ฅผ ์ํํ๋ ๋ฐฉ๋ฒ์ ์ฌ๋ฌ๊ฐ์ง ๋ฐฉ๋ฒ์ด ์๋ค. ๊ณ ์ ์ ์ด๋ผ๋ฉด const arr = [1,2,3,4,5] for(let i = 0; i { console.log(v); }) forEach๋ฅผ ์ฌ์ฉํ ๊ฒ์ด๋ค. ๋๋, ์ดํฐ๋ฌ๋ธ, ์ดํฐ๋ ์ดํฐ์ ๊ฐ๋ ์ ์๊ฑฐ๋, ๋ญ๊ฐ ์ด๋ ๊ฒ ์ฐ๋ ๊ฒ ์ข๋ค๊ณ ๋ค์ผ์ จ๋ค๋ฉด const arr = [1,2,3,4,5] for(const a of arr) { console.log(a); } for of..

๊ณ ์ฐจํจ์๋ ํจ์๋ฅผ ๊ฐ์ผ๋ก ๋ค๋ฃจ๋ ํจ์์ด๋ค. ํจ์๋ฅผ ์ธ์๋ก ๋ฐ์์ ์คํํ๋ ํจ์๋ค์ ์ดํด๋ณด์. const funcAdd = f => f(1); const add10 = a => a + 10; console.log(funcAdd(add10)); ์ funcAdd ํจ์๋ console.log์์ ์ธ์๋ก add10ํจ์๋ฅผ ๋ฐ๋๋ค. ๋น์ฐํ๊ฒ ๊ฒฐ๊ณผ๋ 11๋ก ์์ํ ์ ์๋ค. ํจ์๋ฅผ ๋ง๋ค์ด ๋ฆฌํดํ๋ ๊ฒฝ์ฐ๋ ์๋ค. ์ด๋ฐ ๊ฒฝ์ฐ๋ฅผ ํด๋ก์ ๋ฅผ ๋ง๋ค์ด ๋ฆฌํดํ๋ ํจ์๋ผ๊ณ ๋งํ๋ค. ํจ์๊ฐ ํจ์๋ฅผ ๋ง๋ค์ด์ ๋ฆฌํดํ ๋๋ ๊ฒฐ๊ตญ์ ํด๋ก์ ๋ฅผ ๋ง๋ค์ด์ ๋ฆฌํดํ๊ธฐ ์ํด ์ฌ์ฉํ๋ค. ์๋ ์์๋ฅผ ํ์ธํด๋ณด์, ์ฐ๋ฆฌ๊ฐ ์จ๋ณด์ง ๋ชปํ ๋๋์ arrow Func ๋ก ์ ํ์๋ค. const add = a => b => a + b; const add10 = add(..
react, javascript์์๋ ๋ณดํต sort๋ฅผ ์ด์ฉํด ์ ๋ ฌ์ ๋ง์ดํ๋ค. ๊ทธ๋ฌ๋ sort๋ฅผ ์ฌ์ฉํ๋ฉด ๋ชจ๋๊ฐ ์๋ค์ํผ ์ฝ๋ ๊ฐ๋ ์ฑ์ด ๋ง์ด ๋จ์ด์ง ์ ๋ฐ์ ์๋ค. ๋ํ sort๋ ์ด์ํ ๋ฌธ์ ์ ์ด ์๋ค. const arr = [1,3,20,5]; const sortedArr = arr.sort(); console.log(sortedArr) // [1,20,3,5] sort๋ฅผ ๊ทธ๋ฅ ์ฌ์ฉํ๋ฉด ์์ฒ๋ผ ์ฐ๋ฆฌ๊ฐ ์์ํ๋๋ก ๋์ํ์ง ์๋๋ค...(์๋ฐ์คํฌ๋ฆฝํธ... ใ .ใ ๐ฅฒ) ๊ทธ๋ก์ธํด ์๋ฐ์คํฌ๋ฆฝํธ๋ฅผ ์ฌ์ฉํ๋ ๊ฐ๋ฐ์๋ผ๋ฉด ๋ณดํต ๊ธฐ๋ณธ sort๋ฅผ ๋ฐ๋ก ์ฌ์ฉํ์ง ์๊ณ (a,b) ๋ ์ธ์๋ฅผ ๋น๊ตํ๋ ํจ์๋ฅผ ๋ง๋ค์ด sort๋ฅผ ์ฌ์ฉํ๋ค. const arr = [1,3,20,5]; const sortedArr = arr.sort((a..
๋ค๋ค ๋ฆฌ์กํธ ํ๋ก์ ํธ์์ useState๋ฅผ ์ฐ๋ฉฐ ๋นํฉํ๋ ์ ์ด ์์๊ฑฐ๋ผ ์๊ฐํ๋ค. ๋ฆฌ์กํธ์ useState๋ฅผ ์ฐ๋ค๋ณด๋ฉด ์ฐ๋ฆฌ๊ฐ ์ํ๋ ๋๋ก ๋์ํ์ง ์๋ ๊ฑธ ํ์ธํ ์ ์๋ค. ์๋ ์ฝ๋๋ ์ฒดํฌ๋ฐ์ค๊ฐ ํ๋ ์กด์ฌํ๊ณ ์ฒดํฌํ ๋๋ง๋ค ์ํ toggle ๊ฐ์ด true or false๋ฅผ ๊ฐ์ง๋ ๋ก์ง์ด๋ค. ์ฒดํฌ๋ฐ์ค๋ฅผ ์ฒดํฌํ๋ ๊ฑธ๋ก ์ํ๊ฐ์ ๋ฐ๊พธ๋ ์์๋ฅผ ๋ณด๊ณ ๊ฒฐ๊ณผ๋ฅผ ์์ํด๋ณด์ import React, { useState } from "react"; function App() { const [toggle, setToggle] = useState(false); const onChange = () => { setToggle((toggle) => !toggle); if(toggle) { console.log('toggle์ T..