* 컴포넌트 생명주기의 개념
컴포넌트가 웹 화면에 처음 렌더링되고, 사용자 이벤트에 의하여 화면이 업데이트되고, 사용자가 현재 웹 화면에서 다른 페이지로 이동하면서 컴포넌트는 각자의 라이프 사이클을 가진다. 사람이 처음 태어나서 외모가 변하고 언젠가 생명을 마감하는 것에 비유된다.
* 라이프사이클 도식화 그림
생명주기는 크게 3가지로 분류된다. 컴포넌트가 생성되어 DOM 에 삽입된 경우, 컴포넌트가 업데이트되어 DOM 을 변경해야 하는 경우, 마지막으로 컴포넌트가 DOM 에서 해제되는 경우이다. 각각의 경우에 컴포넌트에서 호출되는 메서드들이 존재한다. 이를 라이프사이클 메서드 또는 생명주기 메서드라고 한다.
* 라이프사이클 메서드와 역할
마운트 - 컴포넌트가 생성되어 DOM 에 삽입되는 경우
메서드 호출 순서는 다음과 같다. 생성자(constructor)가 맨 처음 호출되어 부모 컴포넌트로부터 props 를 전달받고 state 를 초기화한다. 그 다음 render 함수가 호출되면 컴포넌트를 생성한다. JSX 문법 파트에서 설명했던 자바스크립트 객체 형태이다. 마지막으로 실제 DOM 트리에 컴포넌트를 삽입한다. 이를 완료하면 componentDidMount 메서드가 호출된다.
업데이트 - 컴포넌트가 업데이트되고 DOM 을 변경하는 경우
메서드 호출 순서는 다음과 같다. 사용자 이벤트가 발생한다. 이벤트 핸들러 함수에서 setState 메서드가 호출된다. 그 다음 render 함수가 호출되고 변경된 state 로 컴포넌트를 재생성한다. 이후에 재생성한 컴포넌트로 DOM 을 업데이트한다. 이를 완료하면 componentDidUpdate 메서드가 호출된다.
마운트 해제 - 컴포넌트가 DOM 에서 제거되는 경우
componentWillUnmount 메서드가 호출된다. 이 메서드에서는 컴포넌트가 해제되기 직전에 호출되므로 컴포넌트가 마운트될때 설정했던 것들을 해제하고 제거한다. componentDidMount 메서드에 타이머를 설정했다면 해당 메서드에서 해제한다.
import './App.css';
import React, { Component } from 'react';
class App extends Component {
constructor(props){
console.log('constructor')
super(props)
this.state = {
name: "syleemomo"
}
}
changeName = () => {
this.setState({name: "name changed"})
}
componentDidMount(){
console.log('mount')
console.log('----------')
}
componentDidUpdate(){
console.log('update')
}
componentWillUnmount(){
console.log('unmount')
}
render(){
console.log('render')
const {name} = this.state
return (
<div className="App">
<h1>{name}</h1>
<button onClick={this.changeName}>Change name</button>
</div>
)
}
}
export default App;
App 컴포넌트에 위 코드를 작성하자! 개발자 도구를 열어서 콘솔창을 확인해보자!
위와 같이 출력되는가? 컴포넌트가 마운트 될때 constructor 가 먼저 실행되고 render 함수가 호출되고 componentDidMount 메서드가 마지막으로 호출되는 것을 확인할 수 있다.
버튼을 클릭해보자! 버튼을 클릭하면 컴포넌트가 업데이트된다. setState 메서드에 의하여 render 함수가 호출되고 componentDidUpdate 메서드가 호출됨을 확인할 수 있다.
* render
render 는 클래스형 컴포넌트에서 반드시 정의되어야 하는 유일한 메서드이다. 해당 메서드가 실행되면 this.props 와 this.state 를 이용하여 반드시 리액트 엘리먼트를 반환해야 한다. 아래는 자주 하는 실수중 하나다.
import './App.css';
import React, { Component } from 'react'
class App extends Component{
state = {
friends: null
}
setFriends = () => {
this.setState({ friends: [
"sunrise",
"vicvoria",
"hanna"
] })
}
render(){
const { friends } = this.state
if(friends){
return (
<div>친구목록 : {friends.join(', ')}</div>
)
}
}
}
export default App;
friends 상태(state)가 null 이 아니면 반환값이 존재한다. 그러나 초기에는 friends 상태(state)가 null 이므로 조건문을 만족하지 못하고 아무것도 반환되는 값이 없다. 즉, 리액트 엘리먼트를 반환하지 않으므로 아래와 같은 에러 메세지를 출력하고 화면에 아무것도 보이지 않는다.
아래와 같이 조건문을 만족하지 못하는 경우에는 불리언(Boolean) 값이나 null 값 또는 JSX 엘리먼트를 설정해주는 것이 좋다.
import './App.css';
import React, { Component } from 'react'
class App extends Component{
state = {
friends: null
}
setFriends = () => {
this.setState({ friends: [
"sunrise",
"vicvoria",
"hanna"
] })
}
render(){
const { friends } = this.state
if(friends){
return (
<div>친구목록 : {friends.join(', ')}</div>
)
}else{
return (
<>
<div>친구목록이 존재하지 않습니다.</div>
<button onClick={this.setFriends}>친구목록 갱신</button>
</>
)
}
}
}
export default App;
false 나 null 을 반환하는 경우 화면에 아무것도 보이지 않는다.
* constructor
constructor 는 컴포넌트가 마운트 되기 전에 초기에 한번만 실행된다. 그러므로 아래와 같이 컴포넌트에서 사용할 상태(state)를 초기화해주고, 이벤트핸들러 함수에 this 값을 바인딩해줘야 하는 경우에 정의한다.
import './App.css';
import React, { Component } from 'react'
class App extends Component{
constructor(props){
super(props)
this.state = {
color: "red"
}
this.changeColor = this.changeColor.bind(this)
}
changeColor(){
this.setState({ color: "blue" })
}
render(){
const { color } = this.state
return (
<>
<div>{color}</div>
<button onClick={this.changeColor}>색상 변경</button>
</>
)
}
}
export default App;
위 코드는 버튼이 클릭되면 색상에 대한 문자열을 변경한다.
constructor(props){
super(props)
this.state = {
color: "red"
}
this.changeColor = this.changeColor.bind(this)
}
changeColor 를 화살표 함수로 정의하지 않으면 this 값은 undefined 가 된다. 그러므로 constructor 생성자에서 this 값을 바인딩해주어야 한다. 바인딩해주는 this 값은 App 컴포넌트를 가리킨다.
* componentDidMount
componentDidMount 메서드는 컴포넌트가 DOM 트리에 마운트된(삽입된) 직후에 리액트에 의해 자동으로 호출된다. DOM 노드가 있어야 가능한 작업은 여기서 하면 된다. 즉, DOM 을 직접 변경해야 한다면 여기서 하면 된다.
import './App.css';
import React, { Component } from 'react'
class App extends Component{
componentDidMount(){
const photoBox = document.querySelector('.photo-box')
photoBox.innerHTML = "포토 박스"
}
render(){
return (
<>
<div className='photo-box'>
컨텐츠 없음
</div>
</>
)
}
}
export default App;
위 코드는 render 메서드에서 클래스명이 'photo-box' 인 요소를 화면에 렌더링한다. 이후 componentDidMount 메서드에서는 컴포넌트가 DOM 에 삽입된 직후이므로 해당 요소에 접근과 변경이 가능하다.
import './App.css';
import React, { Component } from 'react'
const colors = ["red", "blue", "green", "orange", "skyblue"]
class App extends Component{
state = {
colorIndex: 0
}
changeColor = () => {
this.setState({colorIndex: this.state.colorIndex + 1})
}
componentDidMount(){
this.timerId = setInterval(this.changeColor, 1000)
}
componentWillUnmount(){
clearInterval(this.timerId)
}
render(){
const { colorIndex } = this.state
const color = colors[colorIndex % colors.length]
return (
<div className={`color-box ${color}`}>
{color}
</div>
)
}
}
export default App;
App.js 파일을 위와 같이 작성하자!
.color-box{
width: 100%;
height: 100vh;
display: flex;
justify-content: center;
align-items: center;
font-size: 100px;
font-weight: bold;
color: white;
}
.red{
background: red;
}
.blue{
background: blue;
}
.green{
background: green;
}
.orange{
background: orange;
}
.skyblue{
background: skyblue;
}
App.css 파일을 위와 같이 작성하자!
위 코드는 1초마다 배경화면의 색상을 변경하는 예제이다.
const colors = ["red", "blue", "green", "orange", "skyblue"]
색상을 선택하기 위한 색상 배열을 정의한다.
state = {
colorIndex: 0
}
특정 색상을 선택하기 위하여 색상 배열에서 현재의 인덱스 값을 가지는 colorIndex 상태(state)를 초기화한다.
const { colorIndex } = this.state
const color = colors[colorIndex % colors.length]
colorIndex 상태를 이용하여 색상 배열에서 하나의 색상을 선택한다.
<div className={`color-box ${color}`}>
{color}
</div>
스타일 코드에서 선택한 색상으로 배경화면 색상을 변경한다.
componentDidMount(){
this.timerId = setInterval(this.changeColor, 1000)
}
1초마다 색상이 변경되도록 setInterval 메서드를 사용하여 타이머를 시작한다. 타이머가 시작되면 changeColor 메서드가 1초마다 실행된다. 이러한 작업을 구독(subscription) 이라고 한다.
changeColor = () => {
this.setState({colorIndex: this.state.colorIndex + 1})
}
색상배열에서 다음 색상을 선택하기 위하여 colorIndex 값을 1만큼 증가시킨다.
componentWillUnmount(){
clearInterval(this.timerId)
}
컴포넌트가 DOM 에서 제거되기 전에 반드시 구독을 해제해줘야 한다. 위 코드에서 구독 해제는 타이머 해제를 의미한다. 즉, App 컴포넌트가 DOM 트리에서 언마운트(unmount) 되기 전에 componentDidMount 메서드에서 설정한 타이머를 componentWillUnmount 메서드에서 해제해줘야 한다.
* componentDidUpdate
componentDidUpdate 는 초기 렌더링시에는 호출되지 않고, 이벤트핸들러 함수에 의하여 상태(state)가 업데이트 될때마다 갱신 직후에 호출된다.
import './App.css';
import React, { Component } from 'react'
class App extends Component{
state = {
cnt: 0
}
increase = () => {
this.setState({ cnt: this.state.cnt + 1})
}
componentDidUpdate(prevProps, prevState){
console.log('카운트 업데이트 !')
console.log('직전 카운트 값: ', prevState)
}
render(){
const { cnt } = this.state
return (
<div className='center'>
<div>{cnt}</div>
<button onClick={this.increase}>카운트 증가</button>
</div>
)
}
}
export default App;
위 코드는 버튼을 클릭할때마다 숫자를 카운팅하는 예제이다. 버튼을 클릭하면 이벤트핸들러인 increase 메서드가 먼저 호출된다. 다음은 setState 메서드에 의하여 cnt 상태(state)가 업데이트된다. 이후 render 메서드가 재실행되어 리렌더링이 일어난다. 마지막으로 상태가 업데이트되었으므로 componentDidUpdate 메서드가 실행되면서 아래와 같이 이전 상태를 화면에 출력한다.
import './App.css';
import React, { Component } from 'react'
class App extends Component{
state = {
cnt: 0
}
increase = () => {
this.setState({ cnt: this.state.cnt + 1})
}
componentDidUpdate(prevProps, prevState){
console.log('카운트 업데이트 !')
console.log('직전 카운트 값: ', prevState)
this.increase() // 재귀적으로 계속 실행됨
}
render(){
const { cnt } = this.state
return (
<div className='center'>
<div>{cnt}</div>
<button onClick={this.increase}>카운트 증가</button>
</div>
)
}
}
export default App;
위 코드는 componentDidUpdate 메서드 안에서 다시 increase 메서드를 호출한다. 이렇게 하면 처음 버튼을 클릭했을때 아래와 같은 순서로 메서드가 호출된다. increase -> render -> componentDidUpdate -> increase -> render -> componentDidUpdate -> increase ... 이러한 순서로 재귀적으로 무한반복 실행된다.
하지만 리액트는 위와 같이 무한루프를 방지하기 위하여 최대로 반복 가능한 횟수를 정해놓고 임계점을 넘어가면 프로그램 실행을 정지하고 에러 메세지를 출력하도록 설계되어 있다.
import './App.css';
import React, { Component } from 'react'
const fruits = ["apple", "banana", "orange"]
class App extends Component{
state = {
fruit: fruits[0]
}
changeFruitOrNot = () => {
this.setState({ fruit: fruits[Math.floor(Math.random()*fruits.length)]})
}
componentDidUpdate(prevProps, prevState){
if(this.state.fruit !== prevState.fruit){
console.log('과일 변경됨 !')
console.log('직전에 선택된 과일: ', prevState.fruit)
}else{
alert("현재 선택된 과일은 이전과 동일함")
}
}
render(){
const { fruit } = this.state
return (
<div className='center'>
<div>{fruit}</div>
<button onClick={this.changeFruitOrNot}>과일 변경하기</button>
</div>
)
}
}
export default App;
위 코드는 버튼을 클릭할때마다 과일을 랜덤으로 선택하는 예제이다.
changeFruitOrNot = () => {
this.setState({ fruit: fruits[Math.floor(Math.random()*fruits.length)]})
}
이벤트핸들러 메서드에서는 내장객체인 Math 모듈을 이용하여 fruits 배열에서 랜덤으로 과일을 선택한다.
componentDidUpdate(prevProps, prevState){
if(this.state.fruit !== prevState.fruit){
console.log('과일 변경됨 !')
console.log('직전에 선택된 과일: ', prevState.fruit)
}else{
alert("현재 선택된 과일은 이전과 동일함")
}
}
fruit 상태(state)가 업데이트되면 componentDidUpdate 메서드가 호출되면서 위 코드블럭이 실행된다. componentDidUpdate 메서드에서는 위와 같이 prevProps, prevState 와 같은 파라미터를 사용할 수 있다. prevProps 는 업데이트 직전의 속성(props)이고, prevState 는 업데이트 직전의 상태(state)이다. 만약 fruit 상태가 직전과 동일하면 경고창을 띄워 알려주고, 변경되었으면 직전의 fruit 상태(state)를 출력한다.
그럼 랜덤으로 과일을 선택하더라도 중복이 발생하지 않고 계속 다른 과일을 뽑을수는 없을까?
import './App.css';
import React, { Component } from 'react'
const fruits = ["apple", "banana", "orange"]
class App extends Component{
state = {
fruit: fruits[0]
}
changeFruitOrNot = () => {
this.setState({ fruit: fruits[Math.floor(Math.random()*fruits.length)]})
}
componentDidUpdate(prevProps, prevState){
if(this.state.fruit !== prevState.fruit){
console.log('과일 변경됨 !')
console.log('직전에 선택된 과일: ', prevState.fruit)
}else{
alert("현재 선택된 과일은 이전과 동일함")
// 선택된 과일이 이전과 동일하면 한번더 과일을 선택하기
this.changeFruitOrNot()
}
}
render(){
const { fruit } = this.state
return (
<div className='center'>
<div>{fruit}</div>
<button onClick={this.changeFruitOrNot}>과일 변경하기</button>
</div>
)
}
}
export default App;
App 컴포넌트를 위와 같이 수정하자!
// 선택된 과일이 이전과 동일하면 한번더 과일을 선택하기
this.changeFruitOrNot()
fruit 상태를 체크해서 직전과 동일한 값이면 다시 changeFruitOrNot 메서드를 호출하여 fruit 상태를 변경할 수 있다. 만약 랜덤함수가 계속 동일한 과일을 선택한다면 changeFruitOrNot 메서드는 재귀적으로 호출되어 fruit 상태가 변경될때까지 과일 선택 과정을 반복한다.
* componentWillUnmount
componentWillUnmount 는 컴포넌트가 마운트 해제되어 DOM 트리에서 제거되기 직전에 호출된다. 해당 메서드에서 구독 해제를 하면 된다. 예를 들어 componentDidMount 에서 네트워크 요청을 시도한 경우 해당 메서드에서 네트워크 요청을 취소하면 된다. 또는 componentDidMount 에서 설정한 타이머를 해제할 수도 있다.
해당 메서드 안에서 setState 메서드를 호출하면 안된다. 컴포넌트가 마운트 해제되고 나면 setState 메서드를 호출하더라도 render 메서드가 호출되지 않는다.
import React, { Component } from 'react';
import Counter from './Counter'
class App extends Component {
state = {
toggle: true
}
changeToggle = () => {
this.setState({ toggle: !this.state.toggle })
}
render() {
const { toggle } = this.state
return (
<div>
{toggle? <Counter/> : <h1>컨텐츠 없음</h1>}
<br/>
<button onClick={this.changeToggle}>컴포넌트 보이기/사라지게 하기</button>
</div>
);
}
}
export default App;
App.js 파일을 위와 같이 작성하자!
import Counter from './Counter'
카운팅을 수행하는 Counter 컴포넌트를 불러온다.
state = {
toggle: true
}
Counter 컴포넌트를 보여주거나 사라지게 하기 위한 toggle 상태를 정의한다.
render() {
const { toggle } = this.state
return (
<div>
{toggle? <Counter/> : <h1>컨텐츠 없음</h1>}
<br/>
<button onClick={this.changeToggle}>컴포넌트 보이기/사라지게 하기</button>
</div>
);
}
toggle 상태를 조회한 다음 true, false 에 따라 Counter 컴포넌트를 보여주거나 "컨텐츠 없음" 이라는 문자열을 보여준다. toggle 상태를 변경하기 위한 버튼을 렌더링한다.
changeToggle = () => {
this.setState({ toggle: !this.state.toggle })
}
버튼을 클릭할때마다 toggle 상태를 true 에서 false 로 또는 false 에서 true 로 변경한다.
import React, { Component } from 'react';
class Counter extends Component {
state = {
count: 0
}
componentDidMount(){
this.timerId = setInterval(() => {
this.setState({count: this.state.count + 1})
}, 1000);
}
componentWillUnmount(){
alert("해당 컴포넌트를 보이지 않게 하시겠어요?")
clearInterval(this.timerId)
}
render() {
const { count } = this.state
return (
<div>
<h1>카운팅: {count}</h1>
</div>
);
}
}
export default Counter;
Counter 컴포넌트를 생성하자!
state = {
count: 0
}
숫자 카운팅을 위한 count 상태를 정의한다.
render() {
const { count } = this.state
return (
<div>
<h1>카운팅: {count}</h1>
</div>
);
}
count 상태를 조회하고 화면에 보여준다.
componentDidMount(){
this.timerId = setInterval(() => {
this.setState({count: this.state.count + 1})
}, 1000);
}
componentDidMount 라이프 사이클 메서드를 이용하여 타이머를 설정하고 1초마다 count 상태를 1씩 증가시켜 카운팅한다.
componentWillUnmount(){
alert("해당 컴포넌트를 보이지 않게 하시겠어요?")
clearInterval(this.timerId)
}
App 컴포넌트의 toggle 상태가 false 가 되면 Counter 컴포넌트는 DOM 트리에서 제거되므로 제거되기 직전에 위와 같이 componentWillUnmount 라이프 사이클 메서드가 실행된다. 사용자에게 컴포넌트를 제거해도 될지 물어본 다음에 확인 버튼을 클릭하면 타이머를 해제한다.
* 라이프사이클 활용 예제
무비 리스트를 화면에 보여주는 컴포넌트를 만들어보자!
import './App.css';
import React, { Component } from 'react';
import Movie from './Movie';
class App extends Component {
constructor(props){
super(props)
this.state = {
loading: true,
movies: []
}
}
componentDidMount(){
fetch('https://yts.mx/api/v2/list_movies.json?limit=12')
.then( res => res.json())
.then( result => {
const {data: {movies}} = result
console.log(movies)
this.setState({loading: false, movies})
})
}
render(){
const {loading, movies} = this.state
const style = {
display: 'flex',
flexWrap: 'wrap',
justifyContent: 'center',
alignItems: 'center',
width: '60%',
margin: '100px auto',
textAlign: 'center'
}
const loadingStyle = {
position: 'absolute',
left: '50%',
top:'50%',
transform: 'translate(-50%, -50%)',
fontSize: '2rem'
}
if(loading){
return (
<div style={loadingStyle}>
<h1>Loading ...</h1>
</div>
)
}else{
return (
<div style={style}>
{movies.map(movie => {
return (
<Movie
key={movie.id}
title={movie.title}
genres={movie.genres}
cover={movie.medium_cover_image}
summary={movie.summary}
></Movie>
)
})}
</div>
)
}
}
}
export default App;
App.js 파일에 위와 같이 작성하자!
this.state = {
loading: true,
movies: []
}
화면의 로딩 상태를 알려주는 state, 오픈 API 에서 가져온 무비 리스트를 담을 state 를 초기화하였다.
if(loading){
return (
<div style={loadingStyle}>
<h1>Loading ...</h1>
</div>
)
}else{
return (
<div style={style}>
{movies.map(movie => {
return (
<Movie
key={movie.id}
title={movie.title}
genres={movie.genres}
cover={movie.medium_cover_image}
summary={movie.summary}
></Movie>
)
})}
</div>
)
}
render 함수 안에서는 loading 상태에 따라 로딩 화면을 보여주거나 무비 리스트를 보여주도록 하였다. JSX 문법에서는 중괄호 안에 자바스크립트 표현식이 들어갈 수 있으므로 배열 메서드인 map 을 이용하여 무비 데이터를 Movie 컴포넌트로 변환한다. Movie 컴포넌트의 props 로 title, genres, cover, summary 를 전달한다.
브라우저에서 직접 https://yts.mx/api/v2/list_movies.json 주소로 접속하면 JSON 데이터를 확인할 수 있다. 무비 데이터의 구조는 아래와 같다. 많은 필드가 있지만 여기서는 title, genres, medium_cover_image, summary 만 간단히 사용하였다.
componentDidMount(){
fetch('https://yts.mx/api/v2/list_movies.json?limit=12')
.then( res => res.json())
.then( result => {
const {data: {movies}} = result
console.log(movies)
this.setState({loading: false, movies})
})
}
App 컴포넌트가 DOM 에 마운트되면 componentDidMount 메서드가 호출된다. 즉, 웹페이지 화면이 다 그려지면 호출된다. 여기서는 오픈 API 서버에 접속하여 무비 리스트 데이터를 가져온다. setState 메서드로 state 를 업데이트하면 render 함수가 다시 호출되면서 로딩 화면이 아니라 무비 리스트가 브라우저 화면에 보인다. fetch 함수는 비동기로 동작하며 API 주소에 접속하고 데이터를 가져온다.
import React from 'react';
function Movie({title, genres, cover, summary}){
const style = {
width: '230px',
height: '500px',
background: "white",
margin: '10px',
boxShadow: 'rgba(0, 0, 0, 0.35) 0px 5px 15px'
}
return (
<div style={style}>
<img src={cover} alt={title}></img>
<h3>{title}</h3>
<h4>{genres.join(" ")}</h4>
{/* <p>{summary}</p> */}
</div>
)
}
export default Movie;
Movie.js 파일에 위와 같이 작성하자!
Movie 컴포넌트 내부에서는 전달받은 title, genres, cover, summary 데이터를 이용하여 화면에 렌더링한다. genres 는 배열이므로 join 메서드를 이용하여 하나의 문자열로 변환하였다.
1초마다 자동으로 숫자를 카운팅하는 컴포넌트를 만들어보자!
import './App.css';
import { Component } from 'react';
class App extends Component {
state = {
count: 0
}
increaseCount = () => {
this.setState({ count: this.state.count + 1})
}
componentDidMount(){
this.countID = setInterval(
this.increaseCount
, 1000)
}
componentWillUnmount(){
clearInterval(this.countID)
}
render(){
const { count } = this.state
return (
<div className="App">
<h1>Increase count automatically !</h1>
<h2>{ count }</h2>
</div>
);
}
}
export default App;
App.js 파일을 위와 같이 수정하자!
state = {
count: 0
}
count state 를 0으로 초기화한다.
increaseCount = () => {
this.setState({ count: this.state.count + 1})
}
count 를 1씩 증가시킨다.
componentDidMount(){
this.countID = setInterval(
this.increaseCount
, 1000)
}
setInterval 함수는 윈도우 객체의 메서드이며 브라우저 API 이다. 두번째 인자로 주어진 시간간격만큼 콜백함수를 실행시킨다. 여기서는 1초(1000ms)마다 한번씩 increaseCount 메서드를 호출하고 실행한다. this.countID 는 setInterval 함수가 반환하는 타이머 ID 값이다.
componentWillUnmount(){
clearInterval(this.countID)
}
현재 웹페이지를 벗어나면 componentWillUnmount 메서드가 호출되므로 이때 타이머를 해제(중지)한다.
render(){
const { count } = this.state
return (
<div className="App">
<h1>Increase count automatically !</h1>
<h2>{ count }</h2>
</div>
);
}
count 값을 조회해서 웹화면에 렌더링한다.
그럼 이 코드를 응용해서 사진 데이터를 순차적으로 조회하면서 웹화면에 보여주는 컴포넌트를 만들어보자! 말하자면 이미지 갤러리이다.
구글 이미지 검색에서 내가 보여주고 싶은 이미지에서 마우스 우클릭을 하고, 이미지 주소 복사를 선택한다. 이미지 주소 복사를 하면 이미지 데이터가 복사된다. 이미지 데이터는 base64string 형태이다.
const dummyData = [
{
title: '고양이',
src: 'data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAoHCBUVEhgVFRISGBIYEhgYGBgYEhERERISGBQZGRgVGBgcIS4lHB4rIRgYJzgmKzAxNTU1GiQ7QDs0Py40NTQBDAwMEA8QHhISHjQhISQ0NDQ0MTQ0NDQ0NDQxNDQ0NDQ0NDQ0NDQ0NDQ0NDQxNDQ0NDE0NDQ0MTQ0NDQ0MTQ0NP/AABEIAOEA4QMBIgACEQEDEQH/xAAbAAACAwEBAQAAAAAAAAAAAAAEBQACAwYBB//EADwQAAEDAwIEAwYEBQIHAQAAAAEAAhEDBCESMQVBUWEicYEykaGx0fAGE0LBUmJykuGi8RQVIzOCwvIH/8QAGQEAAwEBAQAAAAAAAAAAAAAAAAEDAgQF/8QAIxEBAQEBAAICAwACAwAAAAAAAAECEQMhEjETIkFhcTJCUf/aAAwDAQACEQMRAD8ABAWjQqgLRqomu0Kztl40KztkgXXSUV903ukprbpVqAqqb/hqrAc3cgyOmcSlNVEcCqaa4B2cCFPc/VTF/aO/tWyMGfksr62DmkEbomz8TYytqlEbR9Fi/tlT60+Zcb4OWOLmjwH4HoldJfSr+1DgRH0XGcU4YWEuaPBv/T2KWN/9dDWP7GVluuis9lzdpuujsjhWRb3Q8KRXKeXHspJcpU4X1FgVtUWBQaOXjRkea9KjNz/SfkUBmF6FFZrSTAGSgnjRK6PhvCRTaKlUDXMsYdm9HvHyC24VwoUmipUE1N2MOzOjnd+yYNGs6jqJz7Oppn+ohR1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yZEX+0R9ahxnEM95AG1RAiryTN1/rO8eVHlaHGQ14fgEF8hzAOfL0ILAR66mnLm3bAtsfCQoI5QdJ+tJOMN/ts8QbaIAeZdbkN++9Lrr3nfOPFCPpzlGLgeomlkt7bqC8NhCzfc3dUYtaDbj7xfFbJ89Pc0w4T/skWQQCZZAx2P40npzFK+HPnwr3GJ+7LrtOa26wyN5RKz5U8xWEF24jFQwyw5HI6FHU7iQZmjf8AQOcTg2v23RiUkaSAw22IOhFfMcZ9k8UjlRbDjkyQQRX07ihuYexnRi2QbwWBXowGpHcaivkGM4zdZ2ZWdAxLZVdoE9KphLpz/wBdbPl3HnRi/FXV1Liv/L6LsUzw1dXUVzG3tWf4v8Sf3j6GurqKd8pBjdRfnXV9/IUttn/Ytd77T31t15XU8Qyb7MYw+v8AN/8AI1E2/juf3XP/AHJXV1OmW33IuJBIm489/wDbt15gtWE66L9BXV1LfTTwo4a5YXMxJh3UTrA+7u6Dt2q/hTn7nDGTP3jLPPLB0npqdO9dXUJ6enGF8QTNrKpM6zpz60mxOm2mjbetdXU08GAeHXWhdTv1PetCw0J5kanrXV1TMotXDl3PuaA4lfYMsMwkiYJE11dSU+Pp7geXkPpSriNxibUknx9T1WurqFLfWY+0Fw57up1gHU6iBpVv2Xci5bAJAzDSfOurqGf/AB/8Ge/9G1q6331zU6ExqdPE1Q+1hiy0aeIV5XUmPsaqfspbBtEkAnI2pAJ96A4J/wCox5ydefvXtdV59T/GkwzFnuZjMLpOsajadqQv8Sd8QJ7/AO4teV1Tx9Vy8G8Qc5Lup/8AVf8A+WtTjVAxCQI8D7eTV7XUfpb4B+zKD+FbQai5PeLg360++yfwp/ao9Mu1dXUuX/IZ5Td/hI5SwjtG1fCeK+G9cC6DM2g0G9dXVf8Al9cv9fj/2Q=='
},
]
export default dummyData;
dummyData.js 를 위와 같이 수정하자!
import './App.css';
import { Component } from 'react';
import animals from './dummyData'
class App extends Component {
state = {
count: 0
}
increaseCount = () => {
this.setState({ count: this.state.count + 1})
}
componentDidMount(){
this.countID = setInterval(
this.increaseCount
, 1000)
}
componentWillUnmount(){
clearInterval(this.countID)
}
render(){
const { count } = this.state
const animal = animals[count%animals.length]
console.log(animal)
return (
<div className="App">
<h1>Image Gallery !</h1>
<img src={animal.src} alt={animal.title}></img>
</div>
);
}
}
export default App;
App.js 를 위와 같이 수정하자!
import animals from './dummyData'
dummyData.js 파일을 임포트해서 동물에 관련된 데이터를 가져온다.
render(){
const { count } = this.state
const animal = animals[count%animals.length]
console.log(animal)
return (
<div className="App">
<h1>Image Gallery !</h1>
<img src={animal.src} alt={animal.title}></img>
</div>
);
}
count 는 계속 증가하지만 animals 배열의 데이터는 한정되어 있으므로 animals[count] 로 코드를 작성하면 결국에는 배열의 인덱스를 조회할 수 없다는 에러 메세지를 반환한다. 그러므로 count%animals.length 로 배열의 인덱스 값만 조회할 수 있도록 한다. 현재 animals 배열의 길이는 5이므로 count%animals.length 를 하게 되면 0, 1, 2, 3, 4 를 계속 생성하면서 배열 요소를 순회한다.
* 연습과제 1
JSX 문법 수업주제의 연습과제에서 만든 Dictionary 컴포넌트에서 웹 화면이 처음 렌더링되었을때 (라이프사이클 메서드 사용하기) 우리가 만든 사전 검색 서비스의 서버에서 데이터를 가져와서 Dictionary 컴포넌트에서 렌더링해보자!
* 연습과제 2
오늘 수업의 자동 카운팅 예제와 이미지 갤러리 예제를 활용하여 아래와 같이 로또번호 6개를 자동 생성하고, 1초마다 보여주는 컴포넌트를 만들어보자! 로또 번호는 1~45 사이 숫자 중 하나를 랜덤으로 뽑는다. (단, 6개의 숫자는 모두 달라야 한다. 즉, 중복이 없어야 한다.)
pickRandomNumber = (min, max) => {
return Math.floor( Math.random() * (max-min+1) ) + min
}
특정한 범위(min <= number <= max)에서 숫자를 랜덤으로 선택하는 코드는 위와 같다. 즉, 로또번호를 뽑으려면 pickRandomNumber(1, 45) 와 같이 호출하면 된다.
* 연습과제 3
const dummyData = [
{
word: 'apple',
meaning: '사과'
},
{
word: 'before',
meaning: '이전의'
},
{
word: 'clean',
meaning: '깨끗한'
},
{
word: 'dummy',
meaning: '가짜의'
},
{
word: 'emergent',
meaning: '긴급한'
},
{
word: 'famouse',
meaning: '유명한'
},
{
word: 'give',
meaning: '(~을) 주다'
},
{
word: 'humble',
meaning: '검소한'
},
{
word: 'ingrave',
meaning: '조각하다'
},
{
word: 'jungle',
meaning: '밀림숲'
},
{
word: 'korea',
meaning: '대한민국'
},
]
export default dummyData;
dummyData.js 파일을 위와 같이 수정하자! 주어진 데이터를 임포트하고 랜덤으로 보여주는 플래쉬카드 영어 단어장 컴포넌트를 만들어보자! 1초에 한 단어씩 랜덤으로 뽑아서 보여주면 된다.
* 연습과제 4
OPEN API 서버로부터 화장품 데이터를 가져와서 화면에 보여주자! Price 버튼을 클릭하면 가격이 낮은 상품부터 정렬해서 보여주고, 다시 버튼을 클릭하면 초기 화면에서의 상품순으로 보여주도록 하자! OPEN API 서버 주소는 다음과 같다. (힌트 :
const API_URL = 'http://makeup-api.herokuapp.com/api/v1/products.json?brand=maybelline'
스타일을 적용하기 위한 CSS 파일은 아래와 같다. 아래 코드를 클래스명으로 설정하면 화면에 위와 같이 보여진다.
.header{
width: 100%;
height: 70px;
position: fixed;
left: 0;
top: 0;
right: 0;
box-shadow: 1px 1px 5px 5px darkgray;
background: white;
z-index: 1;
display: flex;
justify-content: flex-end;
align-items: center;
}
.sort-btns{
all: unset;
width: 100px;
height: 50px;
background: peru;
border-radius: 10px;
cursor: pointer;
color: white;
font-size: 1rem;
font-weight: bold;
text-align: center;
margin-right: 10px;
}
.sort-btns:hover{
opacity: 0.8;
}
.root{
width: 60%;
margin: 100px auto;
display: flex;
flex-wrap: wrap;
justify-content: center;
align-items: center;
}
.product{
flex: 200px;
height: 500px;
box-shadow: 1px 1px 5px 5px peru;
color: white;
background: peru;
margin: 10px;
overflow: hidden;
}
.product-img{
width: 100%;
height: 180px;
overflow: hidden;
}
.product-img img{
width: 100%;
height: 100%;
}
.product-name{
font-weight: bold;
font-size: 1.1rem;
text-align: center;
}
.product-description{
font-weight: 400;
font-size: 0.9rem;
text-align: center;
margin-top: 15px;
}
* 연습과제 5
Node.js 수업에서 만든 할일목록(Todo) 앱 서버를 실행하고, 라이프사이클 메서드를 사용하여 아래와 같이 할일목록을 브라우저 화면에 렌더링해보자! (단, 명령창을 관리자 권한으로 실행해서 net start MongoDB 로 몽고 DB 서버가 켜져 있는지 확인하고, Node.js 서버의 CORS 옵션에 리액트 서버 주소인 localhost:3000 주소가 포함되어 있는지 확인한다.)
'프론트엔드 > React' 카테고리의 다른 글
리액트 기초이론 6 - 요소 참조(ref) (0) | 2021.10.22 |
---|---|
리액트 기초이론 5 - 컴포넌트 스타일링 (0) | 2021.10.22 |
리액트 기초이론 3 - JSX 문법 (0) | 2021.10.22 |
리액트 기초이론 2 - state & props (0) | 2021.10.22 |
리액트 기초이론 0 - 컴포넌트의 개념과 기본적인 동작방식 (0) | 2021.10.22 |