https://emotion.sh/docs/typescript
Emotion – TypeScript
Emotion includes TypeScript definitions for @emotion/react and @emotion/styled. These definitions infer types for css properties with the object syntax, HTML/SVG tag names, and prop types. @emotion/react The easiest way to use the css prop with TypeScript
emotion.sh
이모션 공식 문서대로
tsconfig.json 파일 안에
{
.
.
.
.
"jsx": "react-jsx",
"jsxImportSource": "@emotion/react"
}
이 부분을 추가하자!
css-in-js 스타일 라이브러리중에 emotion이 코드도 깔끔하고 수정이 쉬워서 자주 사용중인데
프로젝트에 typescript를 도입하니 여기저기 에러가 튀어나온다 ...
번들러랑 바벨 다루는게 더 익숙해져야겠지 ~.~
728x90