nexjs + emotion css props 설정

jinsunee·2023년 7월 19일
0

package 추가

yarn add @emotion/react @emotion/styled
yarn add @emotion/babel-plugin -D

.babelrc

{
  "presets": [
    [
      "next/babel",
      {
        "preset-react": {
          "runtime": "automatic",
          "importSource": "@emotion/react"
        }
      }
    ]
  ],
  "plugins": ["@emotion/babel-plugin"]
}

.eslintrc

{
  "extends": "next/core-web-vitals",
  "rules": {
    "react/no-unknown-property": ["error", { "ignore": ["css"] }]
  }
}

tsconfig.json

{
	"compilerOptions": {
		...,
		"types": ["@emotion/react/types/css-prop"]
	}
}
profile
Stay hungry. Stay foolish.

1개의 댓글

comment-user-thumbnail
2023년 7월 19일

좋은 글 감사합니다!

답글 달기