티스토리 뷰
☁️환경☁️
- Yarn
- Next.js (13version)
- TypeScript
1. 설치
yarn add @emotion/react @emotion/styled
2. bael 설정하기
emotion.jsx를 사용하기 위해서는 babel 설정이 필요하다.
- 가장 최상위에서 `.babelrc` 파일 생성하기
- 파일에 아래 코드 작성해 주기
{
"presets": [
[
//기본적으로 next가 가지고 있는 babel
"next/babel",
{
//대신 emotion.jsx 사용 설정
"preset-react": {
"runtime": "automatic",
"importSource": "@emotion/react"
}
}
]
]
}
3. tsconfig.json에 jsxImportSource 추가해주기
//"compilerOptions"
"jsxImportSource": "@emotion/react"
4. 불필요한 파일 삭제(styled)
📦src
┗ 📂pages
┃ ┣ 📂api
┃ ┃ ┗ 📜hello.ts
┃ ┣ 📜index.tsx
┃ ┣ 📜_app.tsx
┃ ┗ 📜_document.tsx
'TIL' 카테고리의 다른 글
Next.js SSR (0) | 2024.08.18 |
---|---|
대한민국 지도 레이어 모델링 파일 만들기 (0) | 2024.08.10 |
Supabase와 Prisma 함께 사용하기 2. migrations (0) | 2024.07.17 |
Supabase와 Prisma 함께 사용하기 1.셋팅 (0) | 2024.07.16 |
access, refresh token의 개념과 관리 방법 요약본 (1) | 2024.07.08 |
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
링크
TAG
- styled component 사용방법
- axios 설치하기
- 유효성검사
- 유효성검사 css
- readme작성해보기
- styled component 조건부 사용방법
- readme 작성 방법
- 별점만들기
- axiosinstance 사용 시 토큰 사용 법
- axios instance 작성하기
- styled component GlobalStyle 사용방법
- Fetch와 Axios 의 장단점
- axios 사용하기
- simple Icon 사용방법
- 별점 색채우기
- 영화별점만들기
- Warning: validateDOMNesting(...): <li> cannot appear as a descendant of <li>
- 에러모음집
- 영화 별점
- readme 작성해야 하는 이유
- axios CRUD
- git cache
- readme 이미지 추가 방법
- nextjs 토큰 만료처리하기
- Warning: Each child in a list should have a unique "key" prop.
- styled component 설치방법
- readme 역할
- Warning: A component is changing an uncontrolled input to be controlled.
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
글 보관함