componentDidUpdate
-
리액트 기초이론 4 - 컴포넌트의 생명주기 (Life cycle) 해답프론트엔드/React 연습과제 해답 2022. 2. 23. 22:19
* 연습과제 2 import './App.css'; import React, { Component } from 'react' class App extends Component { state = { numbers: '' } pickRandomNumber = (min, max) => { return Math.floor( Math.random() * (max-min+1) ) + min } isDuplicated = (numbers, picked) => { return numbers.find(num => num === picked) } getLottoNum = (numbers) => { // console.log("length: ", numbers) const picked = this.pickRandomNumb..
-
리액트 기초이론 4 - 컴포넌트의 생명주기 (Life cycle)프론트엔드/React 2021. 10. 22. 11:15
생명주기 참조문서 React.Component – React A JavaScript library for building user interfaces ko.reactjs.org 생명주기 예시 State and Lifecycle – React A JavaScript library for building user interfaces ko.reactjs.org * 컴포넌트 생명주기의 개념 컴포넌트가 웹 화면에 처음 렌더링되고, 사용자 이벤트에 의하여 화면이 업데이트되고, 사용자가 현재 웹 화면에서 다른 페이지로 이동하면서 컴포넌트는 각자의 라이프 사이클을 가진다. 사람이 처음 태어나서 외모가 변하고 언젠가 생명을 마감하는 것에 비유된다. * 라이프사이클 도식화 그림 참조그림 React Lifecycle Met..