해결된 질문
24.07.26 10:58 작성
·
228
·
수정됨
1
createRoot도 잘 되어있고 하는데도 이 에러가 뜹니다..
import Clock from "./chapter_04/Clock";
const root = ReactDOM.createRoot(document.getElementById("root"));
setInterval(() => {
root.render(
<React.StrictMode>
<Clock />
</React.StrictMode>
);
}, 1000);
reportWebVitals();
ERROR
react_dom_client__WEBPACK_IMPORTED_MODULE_1__.render is not a function TypeError: react_dom_client__WEBPACK_IMPORTED_MODULE_1__.render is not a function at http://localhost:3000/static/js/bundle.js:114:49
답변 2
0
2024. 07. 26. 11:56
import React from "react";
import ReactDOM from "react-dom/client";
import "./index.css";
import App from "./App";
import reportWebVitals from "./reportWebVitals";
import Library from "./chapter_03/Library";
import Clock from "./chapter_04/Clock";
const root = ReactDOM.createRoot(document.getElementById("root"));
setInterval(() => {
root.render(
<React.StrictMode>
<Clock />
</React.StrictMode>
);
}, 1000);
// If you want to start measuring performance in your app, pass a function
// to log results (for example: reportWebVitals(console.log))
// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals
reportWebVitals();
index.js 파일입니다0
2024. 07. 26. 11:07
index.js
파일의 전체 코드를 보여주시거나,GitHub에 공개된 저장소에 코드를 올리시고 링크를 알려주실 수 있을까요?전체 코드를 봐야 정확한 원인을 파악할 수 있을 것 같습니다~감사합니다.
2024. 07. 26. 12:03