본문 바로가기

State2

18Feb2020 TIL 하나의 component 는 한가지 기능만 수행하는 것이 좋다. e.g.) setState() 되는 것 따로 / fetch 되는 것 따로! componentDidMount()는 한 번만 실행된다. this.state는 rendering 될 때 그려지는 요소 저장으로 쓰는 것이 좋다. e.g.) 동영상 리스트, 현재 재생 동영상 등 ref : render 메서드에서 생성된 DOM 노드나 React 엘리먼트에 접근하는 방법을 제공 Dom 안에서 document.queryselector() 나 에 직접 접근하여 값을 가져오거나 값을 변경하거나 기타 등등의 이유로 사용할 때, class Search extends React.Component { constructor(props) { super(props); th.. 2020. 2. 19.
16Feb2020 TIL React : 상호작용이 많은 UI 를 만들 때 사용하는 자바스크립트 기반의 라이브러리 React 특징 Component 기반 JSX Virtual DOM Prop State Component : Components are independent and reusable bits of code. They serve the same purpose as JavaScript functions, but work in isolation and returns HTML via a render function. Components come in two types, Class components and Function components. (출처 : W3school) JSX JSX stands for JavaScript X.. 2020. 2. 17.