๋ฐ˜์‘ํ˜•

next.js study 3

[Next.js] Next์˜ Link์™€ MUI(Material-UI)์˜ Link ์ฐจ์ด

Intro ์•ˆ๋…•ํ•˜์„ธ์š”. ์ด๋ฒˆ์‹œ๊ฐ„์—๋Š” Next์˜ Link์™€ MUI(Material-UI)์˜ Link ์ฐจ์ด์ ์— ๋Œ€ํ•ด ์•Œ์•„๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. Next์˜ Link์™€ MUI(Material-UI)์˜ Link Next.js + React + MUI ์กฐํ•ฉ์œผ๋กœ ๊ฐœ๋ฐœ๊ฒฝํ—˜์ด ์žˆ์œผ์‹  ๋ถ„๋“ค์ด ๊ฝค ์žˆ์œผ์‹ค ํ…๋ฐ์š”, ๊ฐœ๋ฐœํ•˜๋‹ค๋ณด๋ฉด Link ์ปดํฌ๋„ŒํŠธ๋ฅผ ๊ฑฐ์˜ ํ•„์ˆ˜๋กœ ์‚ฌ์šฉํ•˜๊ฒŒ ๋ฉ๋‹ˆ๋‹ค. Next.js์™€ MUI ์—๋Š” ๊ณตํ†ต์œผ๋กœ Link ์ปดํฌ๋„ŒํŠธ๊ฐ€ ๋“ค์–ด์žˆ์Šต๋‹ˆ๋‹ค. ๋ณดํ†ต ์ž๋™ IDE ํˆด์„ ์‚ฌ์šฉํ•˜๋ฉด ์ž๋™์œผ๋กœ import ํ•˜๋Š” ๊ฒฝ์šฐ๊ฐ€ ๋งŽ์€๋ฐ์š”, ๊ผญ ํ™•์ธํ•˜๊ณ  import๋ฅผ ํ•˜์…”์•ผ ํ•ฉ๋‹ˆ๋‹ค. Next.js์˜ Link์™€ MUI(Material-UI)์˜ Link๋Š” ๋ชฉ์ ์ด ๋‹ค๋ฅธ ์š”์†Œ์ด๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค. Why? Next.js์˜ Link ์ปดํฌ๋„ŒํŠธ Next.js์˜ Link ๋Š”..

Framework/Next.js 2023.05.03

[Next.js & React] ํŽ˜์ด์ง€ ์‚ฌ์ „ ๋ Œ๋”๋ง & ๋ฐ์ดํ„ฐ ํŽ˜์นญ

์ด ๊ธ€์€ udemy์˜ Next.js & React - ์™„๋ฒฝ ์ •๋ณต ๊ฐ€์ด๋“œ (incl. Two Paths) ๊ฐ•์ขŒ๋ฅผ ๋ฐ”ํƒ•์œผ๋กœ ์ •๋ฆฌํ•œ ๋‚ด์šฉ์ž…๋‹ˆ๋‹ค. 86. ๋ชจ๋“ˆ ๊ฐœ์š” Next.js๋ฅผ ์ด์šฉํ•˜๋ฉด ํ’€์Šคํƒ React ์•ฑ์„ ๊ตฌ์ถ•ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. Next.js๋Š” ์„œ๋ฒ„ ์‚ฌ์ด๋“œ์—์„œ ํŽ˜์ด์ง€๋ฅผ ์‚ฌ์ „ ๋ Œ๋”๋ง ํ•ด์ค๋‹ˆ๋‹ค. Next.js๋Š” ์ฝ”๋“œ ์‹คํ–‰์— ์žˆ์–ด์„œ ํด๋ผ์ด์–ธํŠธ ์‚ฌ์ด๋“œ ๋ฟ๋งŒ ์•„๋‹ˆ๋ผ React ์•ฑ์ด ์‹คํ–‰๋˜๋Š” ์‚ฌ์šฉ์ž์˜ ๋ธŒ๋ผ์šฐ์ € ๋ฟ๋งŒ ์•„๋‹ˆ๋ผ ์„œ๋ฒ„ ์‚ฌ์ด๋“œ์—์„œ ์ฝ”๋“œ๋ฅผ ์‹คํ–‰ํ•  ๋•Œ๋„ ๋„์›€์„ ์ค๋‹ˆ๋‹ค. ํŽ˜์ด์ง€์— ํ‘œ์‹œ๋˜์–ด์•ผ ํ•˜๋Š” ๋ฐ์ดํ„ฐ๋ฅผ ์ค€๋น„ํ•˜๊ฑฐ๋‚˜ ๋กœ๋”ฉํ•˜๋Š” ์ž‘์—…์„ ๋•๋Š”๋‹ค๋Š” ์˜๋ฏธ์ž…๋‹ˆ๋‹ค. ๋ฐ์ดํ„ฐ fetching์ด ๋ฌด์—‡์ธ๊ฐ€ Static VS Server-side Page ์–ด๋–ป๊ฒŒ ๋ฐ์ดํ„ฐ fetch ํ•˜๋Š”๊ฐ€ ์ด ์˜๋ฏธ์— ๋Œ€ํ•ด ์ž์„ธํžˆ ์‚ดํŽด๋ณด๋„๋ก ํ•ฉ์‹œ๋‹ค. 87. ..

Framework/Next.js 2022.11.21

[Next.js] Error: The default export is not a React Component in page: "/" ์˜ค๋ฅ˜

Intro next js ๋ฅผ ์‚ฌ์šฉํ•˜๋˜ ๋„์ค‘ ์•„๋ž˜์™€ ๊ฐ™์€ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•˜์˜€์Šต๋‹ˆ๋‹ค. Error: The default export is not a React Component in page: "/" Why? ์—๋Ÿฌ๊ฐ€ ๋‚œ ์ฝ”๋“œ๋ฅผ ํ™•์ธํ•ด๋ณด๋‹ˆ, export ๋งŒ ํ•˜๊ณ  default ๋ฅผ ์ ์–ด์ฃผ์ง€ ์•Š์•˜์Šต๋‹ˆ๋‹ค. Next.js์—์„œ๋Š” default๋กœ export๋ฅผ ํ•ด์•ผ ์—๋Ÿฌ ์—†์ด ์ •์ƒ ์ž‘๋™ ๋˜๊ธฐ ๋•Œ๋ฌธ์ž…๋‹ˆ๋‹ค. export function HomePAge() { const featuredEvents = getFeaturedEvents(); return ( ); } How to solve the problem export default ์ฝ”๋“œ๋ฅผ ์ถ”๊ฐ€ํ•ด์ฃผ๋ฉด ๋ฉ๋‹ˆ๋‹ค. ๐Ÿ™Œ export default function HomePAge() { ..

Framework/Next.js 2022.11.08
๋ฐ˜์‘ํ˜•