์ฌ์ฉํ ์ฝ๋๋ ๋ค์๊ณผ ๊ฐ๋ค. { colorArr.map(...) } ํด๋น ์ฝ๋๋ ์ ์๋์ํ์ง๋ง, ํ์๋ getContentAnchorEl์ ์์ฑ์ผ๋ก ์ค์ ํ์ง ์์ผ๋ฉด ๋ค์๊ณผ ๊ฐ์ ์ค๋ฅ๊ฐ ๋ฌ๋ค. Material-UI: You can not change the default `anchorOrigin.vertical` value when also providing the `getContentAnchorEl` prop to the popover component. Only use one of the two props. Set `getContentAnchorEl` to `null | undefined` or leave `anchorOrigin.vertical` unchanged. material-ui์ popove..
![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FbojGsV%2FbtqVdNLpXNm%2FQy3lK12J7XNVFj6Hos5DOk%2Fimg.png)
html2canvas + ์ด๋ฏธ์ง ํธ์คํ *์์ ๋ React Hook ํ๊ฒฝ์์ ์งํ๋์์ต๋๋ค. ๊ฒฐ๊ณผ table์ ์ด๋ฏธ์ง๋ก ๋ง๋ค์ด ๊ณต์ ํด์ผํ๋ ์๊ตฌ์ฌํญ์ด ์์๋ค. ์๊ตฌ์ฌํญ์ ์ํํ๊ธฐ ์ํด์๋ ๋ค์๊ณผ ๊ฐ์ ๊ณผ์ ๋ฅผ ์์ฐจ์ ์ผ๋ก ํด๋ด์ผํ๋ค. html table์ ์ด๋ฏธ์ง๋ก ๋ง๋ค๊ธฐ ๋ง๋ค์ด์ง ์ด๋ฏธ์ง๋ฅผ ํธ์คํ ํ๊ธฐ ํธ์คํ ๋ ์ด๋ฏธ์ง๋ฅผ ์นด์นด์คํก api๋ฅผ ์ด์ฉํ์ฌ ๊ณต์ ํ๊ธฐ ์ฐจ๋ก๋๋ก ํด๋ณด์. html table์ ์ด๋ฏธ์ง๋ก ๋ง๋ค๊ธฐ DOM์์๋ฅผ ์ด๋ฏธ์ง๋ก ๋ง๋ค ๋, html2canvas๋ผ๋ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๊ฐ ์ฃผ๋ก ์ฐ์ธ๋ค. import html2canvas from 'html2canvas'; const copyDOM = async () => { window.scrollTo(0, 0); let url = ""; await html2canvas(..
React์ Material UI๋ผ๋ React UI ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ก ํ๋ก์ ํธ๋ฅผ ํ๋ ์ค, ์ ๋ชฉ๊ณผ ๊ฐ์ ์ค๋ฅ๊ฐ ๋ฐ์ํ๋ค. findDOMNode is deprecated in StrictMode. KOS ํ๋ก์ ํธ์์๋ ๋ฐ๊ฒฌํ๋ ์ค๋ฅ๋ฐ ๋์๋กญ์ง ์๊ฒ ๋๊ฒผ๋๋ ์ฌ๊ธฐ์ ๊ฑธ๋ฆฌ์ ๊ฑฐ๋ฆฌ๋๊ตฐ ใ ใ ์ด์จ๋ ํด๊ฒฐํด๋ณด์. ์ด์ ์ ๋ฐ ์ค๋ฅ๊ฐ ๋จ๋ ์ด์ ๋ ๋ฌด์์ผ๊น? ๋จผ์ , create-react-app์ ํตํด React ํ๋ก์ ํธ๋ฅผ ์์ฑํ๋ฉด, index.js๊ฐ ๋ค์๊ณผ ๊ฐ์ด ์๊ฒผ๋ค. import React from 'react'; import ReactDOM from 'react-dom'; import App from './App'; import reportWebVitals from './reportWebVitals'; ReactDOM..
React JSX์์ array๋ dictionary๋ฅผ ๋ค๋ฃจ๊ธฐ ์ํด forEach ๋ฌธ์ ์ผ๋ค๋ฉด, map์ผ๋ก ๋ณ๊ฒฝํด์ผํ๋ค. map ํจ์๋ ์ฐ์ฐ ํ์ ์์ฑ๋ ๊ฒฐ๊ณผ array / dictionary๋ฅผ ๋ฐํํด์ฃผ๊ธฐ ๋๋ฌธ์ JSX์์ ๋ํ๋๊ฒ ๋์ง๋ง, forEach๋ฌธ์ ๋ณ์์๋ง ์ฐ์ฐ ๊ฒฐ๊ณผ๊ฐ ์ ์ฉ๋๊ณ ๋ฐํํด์ฃผ์ง ์๋๋ค. ๋ฐ๋ผ์, forEach ๋ฌธ์ ์ฌ์ฉํ๊ฒ ๋๋ฉด ์ฐ์ฐ๋ง ๋๊ณ ๊ฒฐ๊ณผ๋ JSX๋ก ์ถ๋ ฅ๋์ง ์๋๋ค.
module.exports = { 'parser': '@typescript-eslint/parser', 'plugins': ['@typescript-eslint'], 'env': { 'commonjs': true, 'browser': true, 'es2021': true, 'node' : true }, 'extends': [ 'airbnb', 'airbnb/hooks', 'plugin:@typescript-eslint/recommended' ], 'parserOptions': { 'project': './tsconfig.json', 'ecmaFeatures': { 'jsx': true, }, 'ecmaVersion': 12, 'sourceType': 'module', }, 'rules': { 'inden..
![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FqypNd%2FbtqP6nZo3uk%2FMsqTCMSK06nkrP1gR5hTA0%2Fimg.png)
Typescript ์ฐธ๊ณ : https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes.html (Typescript ๊ณต์ ์ฌ์ดํธ) ๋ฐฐ์ฐ๋ ์ด์ JS์์๋ Type์ด ๊ณ์ ์ฒดํฌ๋์ง ์๋๋ค. 1. ์ด๋ ์๋ฌต์ ํ๋ณํ, hoisting, ๋ณต์ก์ฑ ๋ฌธ์ ๋ฅผ ์ผ์ผํฌ ์ ์๋ค. ์ด๋ฌํ ์ฝ๋ ์์ ์์์น ๋ชปํ ๋ฒ๊ทธ๋ฅผ ์์ ๊ธฐ ์ํด typescript๋ฅผ ์ฃผ๋ก ์ฌ์ฉํ๋ค. hoisting : ๋์ด์ฌ๋ฆฐ๋ค๋ ๋ป. javascript์์ ์ ์ธ๋ฌธ์ ๋์ด์ฌ๋ ค ์ฝ๋์์ ์ฌ์ฉํ ๋ ์์์ ์๊ด์์ด ์ฌ์ฉ ๊ฐ๋ฅํ๋๋ก ํ๋ ๊ธฐ์ . typescript๋ ๋ณต์กํ ์์ธ์ฒ๋ฆฌ ์ฝ๋ ์์ด ์ด๋ฅผ ์ํํ๋ค. 2. ํ์ ์์๋ ์ถํ์ ๋ณธ์ธ์ด ์ง ์ฝ๋๋ฅผ ๋ณด์์ ๋ ํ์ ์ด ์ ์๋์ด ์์ง ์๋ค๋ฉด ํ๋..
TS2691: import .ts file ์ฐธ๊ณ : https://github.com/microsoft/TypeScript/issues/37582 https://github.com/microsoft/TypeScript/issues/27481 https://github.com/microsoft/TypeScript/issues/39965 ์ด ์ค๋ฅ๋ typescript ํ์ผ์ ์ฐพ์ ์ ์์ด์ ๋๋ ์ค๋ฅ์ด๋ค. import A from 'A.tsx'; ์์ ๊ฐ์ด ํ์ผ์ ๋ถ๋ฌ์ค๋ฉด, import ์ ์ ts / tsx ํ์ผ์ด js / jsx ๋ก ๋ณํ๋๊ธฐ ๋๋ฌธ์ ํด๋น ํ์ผ์ ์ฐพ์ ์ ์๋ค๋ ์๋ฌ๊ฐ ๋ฌ๋ค. ๋ฐ๋ผ์, ๋จ์ํ ํ์ฅ์๋ฅผ ๋ถ์ด์ง ์๊ณ import ํด์ค๋ ๊ฒ์ด ๊ฐ์ฅ ๊ฐ๋จํ ๋ฐฉ๋ฒ์ธ๋ฐ ๊ทธ๋ ๊ฒ ํ๋ฉด esl..
![](https://img1.daumcdn.net/thumb/R750x0/?scode=mtistory2&fname=https%3A%2F%2Fblog.kakaocdn.net%2Fdn%2FnyPoJ%2FbtqZfihdzj8%2FOGRzj3Jtct7gnhHYvDhvCk%2Fimg.png)
[2021-03-04 ์ต์ข ์์ ] ๋ฐ๋จ KOS ํ๋ก์ ํธ ์งํ ์ค์ ์ํ๊ด๋ฆฌ ๋ผ์ด๋ธ๋ฌ๋ฆฌ(Redux, Mobx)๋ฅผ ์ถํ ๋์ ํ๊ธฐ๋ก ํ๊ณ , ๋จผ์ MVVM ํจํด๋ง ์ฌ์ฉํ๊ธฐ๋ก ํ์๋ค. ํ์ง๋ง ๊ธฐ์กด์ ๋์์๋ ํด๋ ๊ตฌ์กฐ๋ค์ ๋ชจ๋ react์ Redux / Mobx ๋ฅผ ์ฐ๋ํ์ฌ ๋ง๋ค์ด๋ธ ๊ตฌ์กฐ๋ค์ด์๋ค. ๋ค์์ ์ํ๊ด๋ฆฌ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ฌ์ฉํ์ง ์๊ณ MVVM ํจํด์ ๊ตฌํํ ์ฌ์ดํธ์ด๋ค. https://github.com/davinci2015/react-mvvm-pokemon ( Class ์ด์ฉ ) https://velog.io/@dlrmsghks7/whatismvvmpattern ( Hook ์ด์ฉ ) ์์ ์ฌ์ดํธ๋ค์์ ์ ์ํ ๊ตฌ์กฐ๋ฅผ ๊ทธ๋ฆผ์ผ๋ก ๋ํ๋ด๋ณด์. View, View Controller, View Model, Model..
Comment