Frontend/React

✅component react는 사용자 정의 태그를 만드는 기술이다. 이것이 react의 본질이다. react에서 사용자 정의 태그를 만들 때는 무조건 대문자로! , 소문자 태그는 html태그이다. react는 이 사용자 정의 태그를 component라고 하는 것이다. function Header(props){ return ( {props.title} ) } function App() { return ( ); } export default App; function Header(props){}와 처럼 함수명과 component 태크명 일치시키기! ※ 함수는 x라는 입력값에 따라 y라는 결과가 나온다. 함수의 x -> 변수 , 파라미터 ✅props props - 속성 props 는 properties 의 줄..
✅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( ); // If you want to start measuring performance in your app, pass a function // to log results (for exa..
1. node.js 설치하기 https://nodejs.org/en Node.js Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine. nodejs.org 2. 바탕화면에 react-app 파일 생성 (파일 이름 아무거나 ) 3. 에디터 열기 (visual studio) 열고 생성한 파일 가져오기 4. 터미널 열고 power shell -> cmd로 바꾸기 터미널에서 node -v 를 통해 node 버전 확인 가능 5. npx create-react-app . (파일을 터미널에서 생성할 때는 . 대신에 파일명을 입력해주면 된다. ) npx create-react-app . 6. npm start : 개발 모드 서버를 실행시킴 n..
2-doooo-2
'Frontend/React' 카테고리의 글 목록 (3 Page)