개발정보

React 실습 #1

쿠카곰돌이 2023. 7. 2. 14:17
반응형

public\index.html

<!DOCTYPE html>
<html lang="ko">
  <head>
    <meta charset="utf-8" />
    <title>AboutW3</title>
  </head>
  <body>
    <div id="root"></div>
  </body>
</html>

src\index.tsx

import React from 'react';
import ReactDOM from 'react-dom/client';

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

root.render(
  <React.StrictMode>
      <h1 id="title">가위바위보</h1>
      <button className="hand">가위</button>
      <button className="hand">바위</button>
      <button className="hand">보</button>
  </React.StrictMode>
);

 

 

 

반응형

'개발정보' 카테고리의 다른 글

크롬 모바일모드 커서 사라짐  (0) 2023.07.04
visual studio code github 연동  (0) 2023.07.02
1.2 React 원도우 환경 설정  (0) 2023.07.02
1.1 React 개요  (0) 2023.07.02
React delete 연산자  (0) 2023.06.26