2-react-practice

2. React Practice

[React] II. 리액트 최초 실습

1. 직접 연결

1) 기본 HTML 구조 만들자.

index.html

<html lang="kr">
    <head>
        <title>use Component</title>
        <link rel="stylesheet" href="style.css">
    </head>
    <body>
        <h1>Hello!</h1>
    </body>
</html>

2) DOM 컨테이너가 될 div 만들기

index.html

3) React.js 불러오기

index.html

4) 우리가 만들 JS 파일 넣기

index.html

5) 새 파일로 MyButton.js 만들기

MyButton.js

짜잔!

2. Create-react-app(CRA) 사용하기

쓸 수 있는 명령어

부록. 전체 파일

직접 연결 - see in githubCRA 생성 결과- see in github

Last updated