목록2024/07/31 (2)
wintertreey 님의 블로그
Props컴포넌트에서 사용하는 데이터는 props와 state가 있다. props 부모 컴포넌트가 자식 컴포넌트에 주는 값. 넘겨줄 수 있는 값은 변수, 배열, 객체, 함수 등 자바스크립트 요소 모두 가능하다. 단, props는 읽기전용으로 값이 변경되어서는 안 된다. props의 값을 변경하고 싶다면, props를 직접적으로 변경하는 것이 아닌 새로운 변수를 선언하여 사용한다. 또한, 데이터는 부모요소에서 자식요소로만 전달이 가능하다. stateState는 컴포넌트의 내부에 현재 저장된 값이며, 변할 수 있는 값이다. 리액트는 값이 변경된 부분을 인지하고 그 부분만 재렌더링한다. 정리Props는 컴포넌트에 전달하는 값으로, 직접 수정 불가능하다State는 컴포넌트 내부에서 선언되어 관리되는 값으로..
초반 세팅 # 2. 로컬 저장소 초기화 git init # 3. 변경 사항 스테이징 git add . # 4. 커밋 생성 git commit -m "Initial commit" # 5. 원격 저장소 추가 git remote add origin https://github.com/username/repository.git # 6. 브랜치 설정 (optional, 만약 main 브랜치를 기본 브랜치로 사용한다면) git branch -M main # 7. 변경 사항 푸시 git push -u origin main 추가 업로드시 $ git add . $ git commit -m "---" $ git push origin main https://blog.naver.com/comma_dev/223530523026 ..