인프런 커뮤니티 질문&답변
index.js 보실분 참고하세욤
작성
·
542
3
import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';
import Libray from './chapter_03/Libray';
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
  <React.StrictMode>
    <Libray />
  </React.StrictMode>
);
// 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();
답변 1
0
Inje Lee (소플)
지식공유자
안녕하세요, S J님. 소플입니다.
먼저 이렇게 친절하게 코드를 올려주셔서 감사합니다.
현재 강의는 리액트 버전 17을 기준으로 제작되어 있어서 index.js의 코드가 조금 다릅니다.
강의 제작 거의 막바지에 리액트 버전18이 나와서 createRoot를 사용하도록 바뀌었습니다.
향후 업데이트시에는 업데이트 된 코드도 함께 제공하도록 하겠습니다.
감사합니다!





