본문 바로가기

React

[React]React말고 next.js사용 next.js 프로젝트 생성하기 next.js 를 생성하는법은 React 프로젝트를 생성할 때 처럼 매우 간단합니다. // React // use npm npm create-react-app 프로젝트명 // use yarn yarn create react-app 프로젝트명 // next.js // npm npx create-next-app // yarn yarn create next-app 일반적인 React와 다를 것이 없습니다…. next.js 개발서버 구동하기 next.js 개발서버 구동도 어렵지 않습니다. // React // use npm npm start // use yarn yarn start // next.js // use npm npm run dev // use yarn yarn dev 더보기
[React]라이프사이클 알아보기 React 라이프사이클이란 React는 컴포넌트 기반의 VIEW 를 중심으로 한 라이브러리입니다. React는 프레임워크 가 아닌 라이브러리 입니다! 그래서 각각의 컴포넌트에는 라이프사이클(LifeCycle), 즉 컴포넌트의 수명 주기 가 존재하는데 이 생명 주기는 컴포넌트가 렌더링 되기 전인 준비과정에서 시작해서 페이지에서 사라질 때 끝나게 됩니다. 참고로 라이프사이클 메서드는 클래스형 컴포넌트에서만 사용이 가능하며 함수형 컴포넌트에서는 사용할 수 없습니다. 다만 React가 업데이트 되면서 Hooks 이 생기면서 함수형 컴포넌트에서도 라이프사이클과 비슷한 작업을 처리할 수 있게 됬습니다. React 라이프사이클 컴포넌트 라이프사이클은 총 9가지로 나눌 수 있는데, 이 9가지들을 크게 3가지의 카테고리.. 더보기
[React] 에러 : A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for .. react_devtools_backend.js:4026 Warning: A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component 영어실력이 부족해서 구글번역을 돌려보면 react_devtools_backend.js:4026 경고: 구성 요소가 제어되지 않는 입력을 제어하도록 변경하고 있습니다... 더보기