에러상황
createPortal 메소드를 사용하려고 ReactDOM을 'react-dom/client'에서 import 하는 도중에 생긴 에러
에러 원인
강의에서 react 18에선 react-dom/client라고 import해야 한다기에 똑같이 입력했었다.
그러나 위와같은 에러를 만났다.
에러 해결
고맙게도 해결방법을 친절히 알려주신 분이 계셨다.
createPortal을 사용할 땐 react-dom,
createRoot를 사용할 땐 react-dom/client !!!
도움받은 곳:
https://github.com/mui/material-ui/issues/11561
Uncaught TypeError: _reactDom.default.createPortal is not a function · Issue #11561 · mui/material-ui
i get this error when i try to use Dialog in material-ui v1 Uncaught TypeError: _reactDom.default.createPortal is not a function at Portal.render (Portal.js:106) at eval (ReactCompositeComponent.js...
github.com
'신나는 오류해결파티!!!' 카테고리의 다른 글
[API오류] type:"cors" 오류 (0) | 2023.01.12 |
---|---|
[에러] Manifest: Line: 1, column: 1, Syntax error (0) | 2023.01.12 |
[오류기록] Module not found: Can't resolve 'react-dom' (0) | 2022.09.16 |
[오류기록] git add .안될때 Another git process seems to be running in this repository (0) | 2022.09.14 |
[오류기록] react_dom_client__WEBPACK_IMPORTED_MODULE_1___default.a.render is not a function (0) | 2022.09.12 |