Web Development/React

index.js

쟤리 2024. 9. 8. 14:41
728x90
반응형

index.js

import React from 'react';
import ReactDOM from 'react-dom/client';
import './index.css';
import App from './App';
import reportWebVitals from './reportWebVitals';

const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
  <React.StrictMode>
    <App />
  </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();

 


 

const root = ReactDOM.createRoot(document.getElementById('root'));

: 구성 요소가 표시되어야 하는 HTML 요소를 정의

 

root.render

: 웹 브라우저 (화면)에 렌더링

 

<React.StrictMode>

애플리케이션 내의 잠재적인 문제를 알아내기 위한 도구

 

reportWebVitals()

: 앱의 퍼포먼스시간들을 분석하여 객체 형태로 보여줌

728x90
반응형

'Web Development > React' 카테고리의 다른 글

CSS 속성  (0) 2024.09.09
버튼 (Button) 컴포넌트  (0) 2024.09.09
리액트 프로젝트 생성  (1) 2024.09.09
리액트 자동완성 기능 활성화  (1) 2024.09.08
리액트 폴더구조  (0) 2024.09.08