웹팩과 함께 import React from "react" 안써보기
'React' refers to a UMD global, but the current file is a module 그냥 기본설정대로 CRA를 썼을 때는 매번 JSX나 TSX의 최상단에 import React from "react"; 이 코드를 넣어서 동작시켜야한다. 반면 Next.js와 같은 환경에서 동작시켰을 때는 저 코드 없이도 JSX를 사용할 수 있는데 그 설정 역시 공식문서에서 다뤄져 있었다. https://ko.reactjs.org/blog/2020/09/22/introducing-the-new-jsx-transform.html Introducing the New JSX Transform – React Blog Although React 17 doesn’t contain new features..
2023.01.06