You can not change the default `anchorOrigin.vertical` value ์˜ค๋ฅ˜
์›น (WEB)/์—๋Ÿฌํ•ด๊ฒฐ 2021. 2. 3. 18:50

์‚ฌ์šฉํ•œ ์ฝ”๋“œ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค. { 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] React hook + Material UI error :: findDOMNode is deprecated in StrictMode.
์›น (WEB)/์—๋Ÿฌํ•ด๊ฒฐ 2020. 12. 20. 21:08

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] React JSX์—์„œ forEach ์•ˆ๋  ๋•Œ
์›น (WEB)/์—๋Ÿฌํ•ด๊ฒฐ 2020. 12. 20. 21:06

React JSX์—์„œ array๋‚˜ dictionary๋ฅผ ๋‹ค๋ฃจ๊ธฐ ์œ„ํ•ด forEach ๋ฌธ์„ ์ผ๋‹ค๋ฉด, map์œผ๋กœ ๋ณ€๊ฒฝํ•ด์•ผํ•œ๋‹ค. map ํ•จ์ˆ˜๋Š” ์—ฐ์‚ฐ ํ›„์— ์ƒ์„ฑ๋œ ๊ฒฐ๊ณผ array / dictionary๋ฅผ ๋ฐ˜ํ™˜ํ•ด์ฃผ๊ธฐ ๋•Œ๋ฌธ์— JSX์—์„œ ๋‚˜ํƒ€๋‚˜๊ฒŒ ๋˜์ง€๋งŒ, forEach๋ฌธ์€ ๋ณ€์ˆ˜์—๋งŒ ์—ฐ์‚ฐ ๊ฒฐ๊ณผ๊ฐ€ ์ ์šฉ๋˜๊ณ  ๋ฐ˜ํ™˜ํ•ด์ฃผ์ง€ ์•Š๋Š”๋‹ค. ๋”ฐ๋ผ์„œ, forEach ๋ฌธ์„ ์‚ฌ์šฉํ•˜๊ฒŒ ๋˜๋ฉด ์—ฐ์‚ฐ๋งŒ ๋˜๊ณ  ๊ฒฐ๊ณผ๋Š” JSX๋กœ ์ถœ๋ ฅ๋˜์ง€ ์•Š๋Š”๋‹ค.

[Typescript] TS2691: import .ts file
์›น (WEB)/์—๋Ÿฌํ•ด๊ฒฐ 2020. 12. 14. 13:58

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..

[ESLint] The react-srcipts package provided by Create React App requires a dependency :: ์˜์กด์„ฑ ๋ฌธ์ œ
์›น (WEB)/์—๋Ÿฌํ•ด๊ฒฐ 2020. 12. 3. 14:42

์˜์กด์„ฑ ์—๋Ÿฌ ํ•ด๊ฒฐ ์—๋Ÿฌ ๋ฐœ์ƒ ์ด๋Ÿฐ ์˜ค๋ฅ˜๊ฐ€ ๋–ด๋‹ค. 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..

[ESLint] createRequire is not a function Referenced from: ...
์›น (WEB)/์—๋Ÿฌํ•ด๊ฒฐ 2020. 12. 3. 12:26

VScode์—์„œ eslint๊ฐ€ ์ ์šฉ์ด ์•ˆ๋˜๊ณ  ์ž๊พธ ํ•ด๋‹น ์—๋Ÿฌ๊ฐ€ ๋œจ๊ธธ๋ž˜ ๊ฒ€์ƒ‰ํ•ด๋ดค๋‹ค. ๋ฒ„์ „์ด ์•ˆ ๋งž์•„์„œ ๊ทธ๋Ÿฐ ๊ฒƒ์ด๋‹ˆ VScode๋ฅผ ๋‹ค์‹œ ๊น”๋ฉด ๋ฒ„์ „ ์—…๋ฐ์ดํŠธ๋˜๋ฉด์„œ eslint๊ฐ€ ์ž˜ ๋œ๋‹ค. ๋‹ค์šด๋กœ๋“œ : code.visualstudio.com/download ์ฐธ๊ณ  : https://github.com/typescript-eslint/typescript-eslint/issues/2020

[eslint] Error: Unexpected token 'export'
์›น (WEB)/์—๋Ÿฌํ•ด๊ฒฐ 2020. 11. 21. 21:46

์ฐธ๊ณ  : 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",์ถ”๊ฐ€ํ•˜๊ธฐ ๋‘ ๋ฐฉ๋ฒ• ์ค‘ ํ•˜๋‚˜๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ๋œ๋‹ค.