Next์˜ css์—์„œ ์“ด font asset์„ ๋นŒ๋“œ ์‹œ ์ œ๋Œ€๋กœ ๋ฐ›์•„์˜ค์ง€ ๋ชปํ•˜๋Š” ์ด์Šˆ
์›น (WEB)/์—๋Ÿฌํ•ด๊ฒฐ 2022. 1. 3. 13:59

์š”์•ฝ css ๋‚ด๋ถ€์˜ font asset์„ ๋ฐ›์•„์˜ค๋Š” path๋ฅผ ์ ˆ๋Œ€๊ฒฝ๋กœ๊ฐ€ ์•„๋‹Œ ์ƒ๋Œ€๊ฒฝ๋กœ๋กœ ๋ฐ”๊พธ๋ฉด ๋œ๋‹ค. ๋ฌธ์ œ css์— url๋กœ ์ •์˜ํ•ด ๋‘” font asset์ด ๊ฐœ๋ฐœ๋ชจ๋“œ(dev)์—์„œ๋Š” ์ž˜ ์ ์šฉ๋˜๋‹ค๊ฐ€ ์‹ค์„œ๋ฒ„(production)์—์„œ ๋ฐ˜์˜๋˜์ง€ ์•Š๋Š” ์ด์Šˆ ์‹ค์ œ ๊ตฌํ˜„ /* style.css */ @font-face { font-family: spoqaSansNeo; font-weight: 700; src:url('/font/SpoqaHanSansNeo-Bold.ttf'); src: url('/font/SpoqaHanSansNeo-Bold.otf') format("opentype"), url('/font/SpoqaHanSansNeo-Bold.ttf') format("truetype"); } /* next.config..

React array state๊ฐ€ ๊ฐฑ์‹ ๋˜์–ด๋„ view๊ฐ€ ๋ฐ”๋€Œ์ง€ ์•Š์„ ๋•Œ
์›น (WEB)/์—๋Ÿฌํ•ด๊ฒฐ 2021. 3. 14. 20:22

React array state๊ฐ€ ๊ฐฑ์‹ ๋˜์–ด๋„ view๊ฐ€ ๋ฐ”๋€Œ์ง€ ์•Š์„ ๋•Œ const [members, setMembers] = useState([]); const deleteMember = (index: number) => { // member ์‚ญ์ œ const tmp = members; tmp.splice(index, 1); setMembers(tmp); } return( { members.map((member: string, index: number) => {member} } ); members๋ผ๋Š” Array state์˜ ๊ฐ’ ํ•˜๋‚˜๋ฅผ ์‚ญ์ œํ•˜๋Š” ํ•จ์ˆ˜์ด๋‹ค. ํ•ด๋‹น ํ•จ์ˆ˜๋ฅผ ์‹คํ–‰ํ•ด๋„ ํ‘œ์‹œ๋˜๋Š” ํ•™์ƒ์ด ๋ณ€ํ•˜์ง€ ์•Š๋Š” ์ด์Šˆ๊ฐ€ ๋ฐœ์ƒํ–ˆ๋‹ค. ํ•˜์ง€๋งŒ ๊ฐœ๋ฐœ์ž๋„๊ตฌ๋ฅผ ํ†ตํ•ด์„œ ๋ณด๋ฉด ๋ถ„๋ช… ํ•ด๋‹น ์ปดํฌ๋„ŒํŠธ์˜ members State๋Š” ๋ณ€๊ฒฝ๋˜..

์ฟ ํ‚ค๊ฐ€ ๋ฐœ๊ธ‰๋˜์ง€ ์•Š์„ ๋•Œ, Access-Control-Allow-Origin ์˜ค๋ฅ˜ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•
์›น (WEB)/์—๋Ÿฌํ•ด๊ฒฐ 2021. 2. 6. 23:35

์ฟ ํ‚ค๊ฐ€ ๋ฐœ๊ธ‰๋˜์ง€ ์•Š์„ ๋•Œ KOS ํ”„๋กœ์ ํŠธ๋Š” ํ”„๋ก ํŠธ์—”๋“œ์— React.js๋ฅผ ์‚ฌ์šฉํ•˜๊ณ  ์„œ๋ฒ„๋Š” go lang ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ gin์„ ์ด์šฉํ•˜์—ฌ ์ง„ํ–‰์ค‘์ด๋‹ค. ์ฒ˜์Œ์— api๋ฅผ ๋งŒ๋“ค๊ณ  ๋‚˜์„œ๋Š” postman์ด๋ผ๋Š” ํˆด๋กœ ์ œ๋Œ€๋กœ ๋™์ž‘ํ•˜๋Š”์ง€ ๊ฒ€์‚ฌํ•œ๋‹ค. ์ฒ˜์Œ์—๋Š” api์—ฐ๊ฒฐ์ด ์ˆœ์กฐ๋กญ๊ฒŒ ๋˜๋‹ค๊ฐ€ ๋กœ๊ทธ์ธ์„ ์œ„ํ•ด์„œ ์ฟ ํ‚ค๋ฅผ ๋ฐœ๊ธ‰ํ•˜๋Š” api๋ฅผ ์ž‘์„ฑํ•œ ์ดํ›„์— ๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ–ˆ๋‹ค. ์ฟ ํ‚ค๊ฐ€ ๋ฐœ๊ธ‰๋˜์ง€ ์•Š๋Š”๋‹ค. ํ”„๋ก ํŠธ์—”๋“œ์—์„œ ๋ฐ›์€ Network๋„ 200์œผ๋กœ ์ •์ƒ์ด๊ณ  set-cookie๋˜๋Š” ๊ฒƒ๊นŒ์ง€ ๋ณด์ด๋ฉฐ response๋ฅผ ์ถœ๋ ฅํ•ด๋ณด์•„๋„ ์ •์ƒ์ด๋‹ค. ๊ทธ๋ ‡๋‹ค๋ฉด ์™œ ์ฟ ํ‚ค๊ฐ€ ๋ฐœ๊ธ‰๋˜์ง€ ์•Š์„๊นŒ? ๋ฐฑ์—”๋“œ์—์„œ ํ”„๋ก ํŠธ์—”๋“œ์— ์ฟ ํ‚ค๋ฅผ ์ €์žฅ์‹œํ‚ค๊ธฐ ์œ„ํ•ด์„œ๋Š” ์–‘์ชฝ์˜ credential ์†์„ฑ์„ ๋ชจ๋‘ ON ํ•ด์ฃผ์–ด์•ผํ•˜๊ธฐ ๋•Œ๋ฌธ์ด๋‹ค. ๋จผ์ € ๋ฐฑ์—”๋“œ(go lang)์˜ ์ฝ”๋“œ๋Š” ๋‹ค์Œ๊ณผ ๊ฐ™๋‹ค. // ..

[go lang] api ๋™์‹œ ํ˜ธ์ถœ ์•ˆ๋˜๋Š” ์˜ค๋ฅ˜ ๊ฐœ์„ ํ•˜๊ธฐ :: No database selected error
์›น (WEB)/์—๋Ÿฌํ•ด๊ฒฐ 2021. 2. 3. 18:55

ํ”„๋ก ํŠธ์—์„œ 2๊ฐ€์ง€ ํ˜ธ์ถœ api๋ฅผ ๊ฐ™์€ ํ•จ์ˆ˜์— ๋‘๊ณ  ๋™์‹œ์— ํ˜ธ์ถœํ•˜์˜€๋”๋‹ˆ, ์„œ๋ฒ„์—์„œ ๋’ท ์ˆœ์„œ๋กœ ํ˜ธ์ถœ๋œ api ์‹คํ–‰ ์‹œ No database selecte error ๊ฐ€ ๋‚œ๋‹ค. ํ•ด๊ฒฐ ๋ฐฉ๋ฒ• : gorm.DB์— ์žˆ๋Š” sql.DB์˜ SetMaxOpenConns ํ•จ์ˆ˜๋ฅผ ์ด์šฉํ•˜์—ฌ, ๋™์‹œ์— ํ—ˆ์šฉ ๊ฐ€๋Šฅํ•œ ์ตœ๋Œ€ ์ปค๋„ฅ์…˜ ๊ฐœ์ˆ˜๋ฅผ ์ œํ•œํ•ด์ฃผ์–ด์•ผํ•œ๋‹ค. Config.DB, err = gorm.Open(mysql.Open(Config.DBURL(Config.BuildDBConfig())), &gorm.Config{}) if err != nil { fmt.Println("Status: ", err) return } // ์•„๋ž˜์˜ ์ฝ”๋“œ๋ฅผ ์ถ”๊ฐ€ํ•ด์ค€๋‹ค. db, err := Config.DB.DB() if err != nil { fmt.Print..

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