์ค๋์ Next JS์์ Client Data fetching ์ฌ์ฉ ์ ๋ง์ฃผํ ์ ์๋ Anchoring ์ด์์ ๋ํด ์ ๋ฆฌํ๋ ค ํฉ๋๋ค. Next JS docs์์ ๊ถ์ฅํ๊ณ ์๋ ์ฝ๋ ์คํ์ผ์ ์ ์ฉํ์ ๋ ์๊ธธ ์ ์๋ ์ด์์ด๊ธฐ ๋๋ฌธ์, ๊ด๋ จ ์ด์๊ฐ ์๊ฒผ์ ๋ ์ ๋ ๋๋ฒ๊น ์ ์๊ฐ์ ๊ฝค๋ ์ผ์ต๋๋ค. ๋จผ์ Next JS์ Data fetching์ ๋ํ ์ง์์ด ์ ๋ฌดํ ๋ถ๋ค์ ์ํด ๊ฐ๋ ๋ถํฐ ์ ๋ฆฌํ๊ณ ์ด์์ ๋ํ ํด๊ฒฐ ๊ณผ์ ์ ์ฐจ๋ก๋ก ์ ์ด๋ณด๊ฒ ์ต๋๋ค. Data fetching Next JS๋ฅผ ์ด์ฉํ Data fetching์๋ ๋ค์๊ณผ ๊ฐ์ ๋ฐฉ๋ฒ์ ์ฌ์ฉํ ์ ์์ต๋๋ค. ์์ธํ ๋ด์ฉ์ ๊ณต์ ๋ฌธ์๋ฅผ ์ฐธ์กฐํด์ฃผ์ธ์! getStaticProps / getServerSideProps : Server Side์์ ๋ฏธ๋ฆฌ page h..
๋ฌธ์ ์ํฉ next/link๋ฅผ ์ฌ์ฉํ GNB์ mouseEnter event๊ฐ ์๋ํ์ง ์์์ ๋ฉ์ธ ๋ฉ๋ด์ ๋ง์ฐ์ค๋ฅผ ์์ง์ฌ๋ subMenu๊ฐ ๋ฐ๋์ง ์๋ ์ด์๊ฐ ๋ฐ์ํ๋ค. ์์ธ GNB์์ ์ฌ์ฉํ๋ LinkContext์ SuperLink๋ฅผ next/link๋ก ์ฒ๋ฆฌํ๋๋ฐ, next 12 version์์ mouseHover ์ด๋ฒคํธ๊ฐ ์ ๋๋ก ์๋ํ์ง ์๋ ๋ฌธ์ ๊ฐ ์๋ค. fix(Link): Do not ignore onMouseEnter prop with absolute href by ericmatthys · Pull Request #32012 · vercel/next.js Fixes #22733 Regardless of whether it's recommended that Link be used with e..
์์ฝ css ๋ด๋ถ์ font asset์ ๋ฐ์์ค๋ path๋ฅผ ์ ๋๊ฒฝ๋ก๊ฐ ์๋ ์๋๊ฒฝ๋ก๋ก ๋ฐ๊พธ๋ฉด ๋๋ค. ๋ฌธ์ css์ url๋ก ์ ์ํด ๋ font asset์ด ๊ฐ๋ฐ๋ชจ๋(dev)์์๋ ์ ์ ์ฉ๋๋ค๊ฐ ์ค์๋ฒ(production)์์ ๋ฐ์๋์ง ์๋ ์ด์ ์ค์ ๊ตฌํ /* style.css */ @font-face { font-family: spoqaSansNeo; font-weight: 700; src:url('/font/SpoqaHanSansNeo-Bold.ttf'); src: url('/font/SpoqaHanSansNeo-Bold.otf') format("opentype"), url('/font/SpoqaHanSansNeo-Bold.ttf') format("truetype"); } /* next.config..
์ํฉ next.js์์๋ SSR์ ์ฌ์ฉํ๊ธฐ ๋๋ฌธ์ url์ ์๋ query๋ฅผ ๋ฐ์์ฌ ์๊ฐ ์๋ค. ํด๊ฒฐ 1 next page์์ getServerSideProps ํจ์๋ฅผ ์ด์ฉํด query๋ฅผ ๋ฐ์์ฌ ์ ์๋ค. const Page: NextPage = ({ params }) => { } export async function getServerSideProps (context) { const req = context.req; const params = new URLSearchParams(req._parsedUrl.query); return { props: { params } }; }โ ํด๊ฒฐ 2 ํด๊ฒฐ 1์ ๋ฐฉ๋ฒ์ผ๋ก page ๋ด๋ถ์์๋ url parameter๋ฅผ ์ฌ์ฉํ ์ ์๋ค. ํ์ง๋ง _app.tsx์ ๊ฐ์ด ne..
Comment