์ฌ์ฉํ ์ฝ๋๋ ๋ค์๊ณผ ๊ฐ๋ค. { 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..
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๋ก ์ถ๋ ฅ๋์ง ์๋๋ค.
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..
์์กด์ฑ ์๋ฌ ํด๊ฒฐ ์๋ฌ ๋ฐ์ ์ด๋ฐ ์ค๋ฅ๊ฐ ๋ด๋ค. CRA๊ฐ ์ ๊ณตํ๋ react-scripts ํจํค์ง๊ฐ eslint 6.6.0 ๋ฒ์ ์ ์์กดํ๋๋ฐ, 7.2.0 ๋ฒ์ ์ ์ค์นํด์ ๊ทธ๋ ๋ค๊ณ ํ๋ค. ์ ๋ฐ์ ๋์ค๋ ํด๊ฒฐ๋ฐฉ๋ฒ์ด ์๋๋ฐ, ๋ฐ๋ผํด๋ ํด๊ฒฐ๋์ง ์๋๋ค ใ ... ์ ๋ฒ์๋ ๊ฐ์ ๋ฌธ์ ๋ก ์์ฉ์ฌ์ ์ด๋ฒ์ ์ ๋๋ก ๊ฐ์ก๊ณ ํด๊ฒฐํด๋ณด๋ ค๊ณ ํ๋ค. ์ด์ ๋ฐ๊ฒฌ ์ด์ ๋ ๊ตฌ๊ธ๋งํ๋ค๊ฐ ๋ฐ๊ฒฌํ๋๋ฐ(https://github.com/wesbos/eslint-config-wesbos/issues/17) , react-scripts์ eslint ์์กด์ฑ ๋ฒ์ ๊ณผ airbnb linting์์์ eslint ์์กด์ฑ ๋ฒ์ ์ด ์ผ์นํ์ง ์์์ ๋์ค๋ ๋ฌธ์ ์๋ค. ๋ป์ง ๊ทธ๋์ ์ผ๋จ react-scripts version์ `npm view react-s..
VScode์์ eslint๊ฐ ์ ์ฉ์ด ์๋๊ณ ์๊พธ ํด๋น ์๋ฌ๊ฐ ๋จ๊ธธ๋ ๊ฒ์ํด๋ดค๋ค. ๋ฒ์ ์ด ์ ๋ง์์ ๊ทธ๋ฐ ๊ฒ์ด๋ VScode๋ฅผ ๋ค์ ๊น๋ฉด ๋ฒ์ ์ ๋ฐ์ดํธ๋๋ฉด์ eslint๊ฐ ์ ๋๋ค. ๋ค์ด๋ก๋ : code.visualstudio.com/download ์ฐธ๊ณ : https://github.com/typescript-eslint/typescript-eslint/issues/2020
์ฐธ๊ณ : https://hoilzz.github.io/webpack/11-eslint-prettier/ eslint์ parser๊ฐ ๊ณต์์ ์ผ๋ก ES ํ์ค๋ง์ ์ง์ํ๊ธฐ ๋๋ฌธ์, ES6~7 ํ์ฑ ์ ๋ฌธ์ ๊ฐ ์๊ธด๋ค. ๋ฐ๋ผ์, .eslintrc.js ํ์ผ์ export default๋ฅผ module.export๋ก ๋ณ๊ฒฝํ๊ธฐ export๋ ES6 syntax์ด๊ณ , module export๋ commonJS syntax์ด๋ค. babel-eslint ์ค์น ํ .eslintrc.js์ "parser": "babel-eslint",์ถ๊ฐํ๊ธฐ ๋ ๋ฐฉ๋ฒ ์ค ํ๋๋ฅผ ์ฌ์ฉํ๋ฉด ๋๋ค.
Comment