▶ 개발환경 세팅
▶ node.js 설치
npx creat-react-app my-app
React작업할 파일내에서 터미널 사용
▶ 기본파일들
라이브러리 모아놓는곳
static 파일 모아놓는곳(html, image파일 잠간 넣어둘때...)
코드 작업하는 곳
프로젝트정보(프로젝트명, version, 라이브러리 명들)
src - 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();
react,react-dom,app제외한 모든 import삭제
src-app.js
import './App.css';
import {useState} from 'react';
function App() {
return (
<div className="App">
</div>
)
}
export default App;
<div></div>안에 내용 삭제
'Web_Study > React_JS' 카테고리의 다른 글
Import, Export (0) | 2024.07.10 |
---|---|
React Router (0) | 2024.01.13 |
UseEffect (0) | 2024.01.13 |
Props (0) | 2024.01.13 |
ReactJS_2:JSX_Syntax (0) | 2022.05.22 |