๋ชฉ๋ก2022/03/15 (3)
whatisthis?
๐ฒ ํฑํํ (Tic Tac Toe) ๊ฒ์ Ref. ์์ต์: React ์์ํ๊ธฐ – React A JavaScript library for building user interfaces ko.reactjs.org index.html style.css body { font: 14px "Century Gothic", Futura, sans-serif; margin: 20px; } ol, ul { padding-left: 30px; } .board-row:after { clear: both; content: ""; display: table; } .status { margin-bottom: 10px; } .square { background: #fff; border: 1px solid #999; float: lef..
React.js Day 03 React Hooks + WebPack ๐พ PART 1 220315 [TIL] Today I Learned ๐ฏ React.js - (1) React.js Day 03 React Hooks + WebPack 1 / React Hooks ๋ฆฌ์กํธ์์ ์ถ์ฒํ๋ ๊ฒ = Hooks์ ์ฌ์ฉ. Class Component๋ฅผ ์์ ํ๊ณ , ํจ์ํ ํ๋ก๊ทธ๋๋ฐ์ ์ํ Hooks๋ฅผ ๊ถ๊ณ ํจ. ํด๋์ค ์ปดํฌ๋ํธ class Button extends.. mywebproject.tistory.com * ์ง๊ธ๊น์ง์ ์ฝ๋ ๐ webpack.config.js const path = require("path"); module.exports = { name: "wordrelay-setting", mode: "devel..
React.js Day 03 React Hooks + WebPack 1 / React Hooks ๋ฆฌ์กํธ์์ ์ถ์ฒํ๋ ๊ฒ = Hooks์ ์ฌ์ฉ. Class Component๋ฅผ ์์ ํ๊ณ , ํจ์ํ ํ๋ก๊ทธ๋๋ฐ์ ์ํ Hooks๋ฅผ ๊ถ๊ณ ํจ. ํด๋์ค ์ปดํฌ๋ํธ class Button extends React.Component { // ์๋ต render () { return ( ) } ํจ์ํ ์ปดํฌ๋ํธ const Button = () => { // ์๋ต return } ์๋๋ ํจ์ํ ์ปดํฌ๋ํธ๊ฐ ์์๋๋ฐ, ๊ทธ์ ์๋ state๋ ref ๋ฑ์ ํด๋์ค์์๋ง ์ธ ์ ์์๋ค. ๐ก ํจ์ํ์์๋ state๋ ref๋ฅผ ์ธ ์ ์๊ฒ ๋ง๋ ๊ฒ = React Hooks (+ useEffect) useState() React.useState()..