Framework/React

Module '"react"' has no exported member 'useState'

반응형
Module '"react"' has no exported member 'useState'
Module '"react"' has no exported member 'useRef'
Module '"react"' has no exported member 'useEffect'

react의 버전과 @types/react의 버전이 다를 때 문제가 생길 수 있다. apache echart를 설치하다가 @types/react를 설치해야 한다길래 따라했다가 낭패를 보았다. 버전을 다운그레이드 한 모양이다.

Hooks는 React 16.8.0 버전 이상에서만 사용 가능하다. Hooks are only available in React 16.8.0 and up. 

https://stackoverflow.com/questions/68512538/can-import-react-but-not-usestate

 

can import React, but not useState?

I am attempting to write a cordova app with ts and react by starting with the boilerplate: https://github.com/davidgerrard/cordova-react-typescript-webpack-boilerplate The cloned code works fine, but

stackoverflow.com

https://ko.reactjs.org/docs/hooks-intro.html#gatsby-focus-wrapper

 

728x90
반응형