๋ชฉ๋ก2022/03/17 (3)
whatisthis?
Dev Blog whatisthis? ๐ web study & project archive ๐บ https://github.com/thisisyjin mywebproject.tistory.com ๊ฐ๋ฐ ๊ณต๋ถ ๊ฐ๋ฐ ์ฐ์ต ํ๋ก์ ํธ ์คํจ ํธ์ง Naver Blog ๊ธฐ๋ก : ๋ค์ด๋ฒ ๋ธ๋ก๊ทธ ๊ธฐ๋ก :) https://mywebproject.tistory.com blog.naver.com ์ผ์ ์๊ฒฉ์ฆ ๊ณต๋ถ ํ์๋ฉ์ค ๊ณํ Velog thisisyjin (thisisyjin) - velog TIL 22-03-17 React.js Today I Learned ... react.js >๐โ๏ธReact.js Lecture >๐My Dev Blog ๐ ์์ - ๋๋ง์๊ธฐ ๊ฒ์ WordRelay.jsx Hooks ์ด์ฉ์ ๐ก targ..
React.js Today I Learned ... react.js ๐โ๏ธReact.js Lecture ๐My Dev Blog ๐ ์์ - ๋๋ง์๊ธฐ ๊ฒ์ WordRelay.jsx const React = require("react"); const { Component } = React; class WordRelay extends Component { state = { word: "๊ฐ์์ง", value: "", result: "", }; onSubmitForm = e => { e.preventDefault(); if (this.state.value[0] === this.state.word[this.state.word.length - 1]) { this.setState(prevState => ({ res..
React.js ๐ฉ ๋ชฉ์ฐจ - ํด๋์คํ ์ปดํฌ๋ํธ - ํจ์ํ ์ปดํฌ๋ํธ - ๋ฐฐ์ด ์ปดํฌ๋ํธ - ์ปดํฌ๋ํธ์์์ ์ฝ๋ฐฑ๊ณผ ์ด๋ฒคํธ๋ฆฌ์ค๋ ํด๋์คํ ์ปดํฌ๋ํธ ์๋ช ์ฃผ๊ธฐ ๋ฉ์๋์ ์ปดํฌ๋ํธ ๊ตฌ์ฑ์์๋ฅผ ๋ชจ๋ ํฌํจํ๋ ํด๋์คํ ์ปดํฌ๋ํธ. ์ด ๋๊ฐ์ง ์ข ๋ฅ์ ํด๋์ค๋ฅผ ์ฌ์ฉ. - Component - PureComponent 1 / Component ํด๋์ค - props, state, life-cycle method๊ฐ ๋ค์ด์๋ ๊ตฌ์กฐ์ ์ปดํฌ๋ํธ 2 / PureComponenet ํด๋์ค - Component ํด๋์ค๋ฅผ ์์๋ฐ์ ํด๋์ค. - shouldComponentUpdate() ํจ์๋ฅผ ์์ ๋น๊ต๋ฅผ ํ๋๋ก ์ฌ์ ์. ๐ shouldComponentUpdate(nextProps, nextState) ํ๋กํผํฐ๋ฅผ ๋ณ๊ฒฝํ๊ฑฐ๋ setState()๋ฅผ ..