목록nextjs (2)
뉴히의 개발 로그

Page.tsx 가 메인페이지 그를 감싸는 Layout.tsx 페이지생성은 src 아래 폴더생성(subpage)>page.tsx 파일생성하면 페이지 생성완료 ex) http://www.ddd.com/subpage subpage에 page.tsx는 같은 레벨에 layout파일이 있다면 layout으로 감싸지며 그상위 폴더에 layout파일이 또있으면 또 감싸지고 그상위 폴더에 layout파일로 또감싸진다 page router의 경우는 pages > index.tsx -> main pages폴더 아래 파일을 생성하면 페이지생성이 완료 된다. ex) pages>about.tsx --> www.ddd.com/about 다이나믹 라우팅의 경우 app 폴더아래 첫번빼 경로 폴더를 만들고 다이나믹하게 바뀌는 segm..
React
2024. 3. 5. 10:31

프로젝트 생성 node 먼저 설치가 되어있어야한다. // 최신 버전 설치 npx create-next-app@latest 프로젝트명 // start with typescript (tailwind, eslint도 한번에 설치) npx create-next-app@latest 프로젝트명 --typescript --tailwind --eslint // yarn yarn create next-app yarn create next-app --typescript 프로젝트 실행 cd 해당 프로젝트 npm run dev http://localhost:3000/에서 초기 화면 확인가능
React
2024. 3. 4. 19:14