nextJS 기초


nextJS 기초

ReactJS와 nextJS 큰 차이점 reactJS: CSR 클라이언트 사이드 렌더링 JS가 렌더링 되기전에 HTML이 안보여서 하얀창으로 보일수가 있음 SEO최적화 등등 에로사항이 있음 nextJS: SSR 서버 사이드 렌더링 이미 만들어진 페이지를 줌 (초기상태가 만들어진상태) SEO최적화 등등에서 이점이 있음 nextJS 스타일 방법 3가지 방법1 reactJS 스타일 주듯이 객체형태로 주기 import Link from "next/link"; import { useRouter } from "next/router"; export default function NavBar() { const router = useRouter(); console.log(router); return ( <nav> <Link style={{ color: router.pathname === "/" ? "red" : "blue" }} href="/" > Home </Link> <Link style={{ ...



원문링크 : nextJS 기초