
App.jsx -> main.jsx -> index.html
React가 실제 DOM에 앱을 끼워 넣는 자리(마운트 포인트)
<div id="root"></div>
const root = document.querySelector("#root");
import { createRoot } from 'react-dom/client';
import App from './App.jsx';
const create = createRoot(root);
create.render(<App />);
-> main.jsx는 index.html의 div id="root"와 React의 가상 DOM을 연결하는 다리 역할
function App() {
return (
<div>
<h1>안녕하세요 React!</h1>
</div>
);
}
export default App;