๐Ÿ‘ฉ‍๐Ÿ’ป๊ฐœ๋ฐœ_TIL 23

[๋ฆฌ์•กํŠธ]img elements must have an alt prop

์ด๋ฏธ์ง€๋ฅผ ๋ Œ๋”๋งํ•  ๋•Œ ์œ„์™€ ๊ฐ™์€ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค. ์ฐพ์•„๋ณด๋‹ˆ img ํƒœ๊ทธ์— alt ์†์„ฑ์„ ์ถ”๊ฐ€ํ•˜์ง€ ์•Š์œผ๋ฉด ๋ฐœ์ƒํ•˜๋Š” warning์ด๋ผ๊ณ  ํ•ฉ๋‹ˆ๋‹ค. (์ถœ์ฒ˜: stackoverflow) What does this warning message mean? 'img elements must have an alt prop, either with meaningful text, or an empty string for de Why am I getting this warning? warning: img elements must have an alt prop, either with meaningful text, or an empty string for decorative images jsx-a11y/img-has-alt I..

[๋ฆฌ์•กํŠธ]You are running `create-react-app` x.x.x, which is behind the latest release (x.x.x)

๊ฐœ์ธ ํ”„๋กœ์ ํŠธ๋ฅผ ์ƒ์„ฑํ•˜๊ธฐ ์œ„ํ•ด ํ„ฐ๋ฏธ๋„์— ๋ช…๋ น์–ด๋ฅผ ์ž…๋ ฅํ–ˆ๋”๋‹ˆ, ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค. create-react-app์˜ ๋ฒ„์ „์ด ์ตœ์‹ ์ด ์•„๋‹ˆ๋ผ์„œ ์ƒ๊ธฐ๋Š” ๋ฌธ์ œ์ธ ๊ฒƒ๊ฐ™์Šต๋‹ˆ๋‹ค. ํ•ด๊ฒฐ ๋ฐฉ๋ฒ• stackoverflow์—์„œ ํ•ด๋‹น ์—๋Ÿฌ๋ฅผ ๊ฒ€์ƒ‰ํ•ด๋ณด๋ฉด ๋‹ค์Œ๊ณผ ๊ฐ™์€ ๋‹ต๋ณ€์„ ์ฐพ์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. (์ถœ์ฒ˜: stackoverflow) create-react-app is not working since version 4.0.1 I tried installing create-react-app using npm i create-react-app, npx create-react-app new-app and npm init react-app new-app, but I keep getting this error message: You ..

[๋ฆฌ์•กํŠธ]<a> cannot appear as a descendant of <a>

react-router์˜ Link์™€ ํƒœ๊ทธ์˜ ๊ธฐ๋Šฅ์ด ์ค‘๋ณต๋˜์–ด ๋ฐœ์ƒํ•˜๋Š” ์˜ค๋ฅ˜์ž…๋‹ˆ๋‹ค. ๋ฅผ ์ง€์šฐ๊ณ  aํƒœ๊ทธ์˜ ์†์„ฑ์— as={Link}์™€ to="์—”๋“œํฌ์ธํŠธ" ์™€ ๊ฐ™์ด ์ž‘์„ฑํ•˜๋ฉด ๋ฉ๋‹ˆ๋‹ค. as = {Link} aํƒœ๊ทธ๋ฅผ Link ์ฒ˜๋Ÿผ ์‚ฌ์šฉํ•˜๊ฒ ๋‹ค๊ณ  ์ •ํ•ด์ค๋‹ˆ๋‹ค. to = "์—”๋“œํฌ์ธํŠธ" Link์™€ ๋™์ผํ•˜๊ฒŒ ์ด๋™ํ•  ์ฃผ์†Œ๋ฅผ ์ง€์ •ํ•ฉ๋‹ˆ๋‹ค. ํฌ์ธํŠธ๋Š” as๋ผ๋Š” ํ‚ค์›Œ๋“œ๋กœ ํƒœ๊ทธ๋ฅผ ์ฒ˜๋Ÿผ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ๋‹ค๋Š” ์ ์ž…๋‹ˆ๋‹ค.๐Ÿ˜Ž

[๋ฆฌ์•กํŠธ]Invalid DOM property class. Did you mean className?

JSX๋Š” ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ์˜ ์ผ๋ถ€์ด๋ฏ€๋กœ class๋ผ๋Š” ํ‚ค์›Œ๋“œ๋ฅผ ์‚ฌ์šฉํ•˜๋ฉด ์ด๋ฏธ ์กด์žฌํ•˜๋Š” class ๋ฌธ๋ฒ•๊ณผ ์ค‘๋ณต๋ฉ๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ HTML ํƒœ๊ทธ์— ํด๋ž˜์Šค๋ช…์„ ์ง€์–ด์ค„ ๋•Œ๋Š” className์œผ๋กœ ์ž‘์„ฑํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. https://bit.ly/3nkoLZb [React] JSX์˜ค๋ฅ˜ํ•ด๊ฒฐ - Warning: Invalid DOM property `class`. Did you mean `className`? React๋ฅผ ํ™œ์šฉํ•œ ๊ฐœ๋ฐœ์„ ์ง„ํ–‰ํ•˜๋ฉด์„œ JSX๋Š” javaScript์ด๋ฏ€๋กœ class์˜ ๋‹ค๋ฅธ ์˜๋ฏธ๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. ๋ฌด๋ฃŒํ…œํ”Œ๋ฆฟ์ด๋‚˜ ํผ๋ธ”๋ฆฌ์‹ฑ ์ž‘์—…์„ ์ „๋‹ฌ๋ฐ›์•˜์„ ๋•Œ JSX์—์„œ class์˜ ์˜ค๋ฅ˜๋ฅผ ๋ณด๊ฒŒ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. HTML ํƒœ๊ทธ ์†์„ฑ์„ mandlife.tistory.com App.js๋ฅผ ํ™•์ธํ•ด๋ณด๋‹ˆ, ์ œ๊ฐ€ Bootstrap์—์„œ ์‚ฌ์šฉํ•œ N..

[TIL]๊ฐ์ฒด์˜ ํ”„๋กœํผํ‹ฐ ๋ช…์— ๋”ฐ์˜ดํ‘œ?

๐Ÿค”๊ถ๊ธˆํ–ˆ๋˜ ๊ฒƒ๋“ค 1. ๊ฐ์ฒด์˜ ํ”„๋กœํผํ‹ฐ ๋ช…์— ๋”ฐ์˜ดํ‘œ๋ฅผ ์–ธ์ œ๋Š” ๋ถ™์ด๊ณ , ์–ธ์ œ๋Š” ์•ˆ ๋ถ™์ด๋Š”์ง€? ์‚ฌ์šฉํ•˜์ง€ ์•Š์•„๋„ ๋˜์ง€๋งŒ, property๋ช…(key) ์— ๋„์–ด์“ฐ๊ธฐ๊ฐ€ ์žˆ๋Š” ๊ฒฝ์šฐ์—๋Š” ๋”ฐ์˜ดํ‘œ๋ฅผ ๋ถ™์—ฌ์•ผ ํ•œ๋‹ค๊ณ  ํ•ฉ๋‹ˆ๋‹ค. (์ถœ์ฒ˜: ์ œ๋กœ์ดˆ๋‹˜ ๋ธ”๋กœ๊ทธ) (JavaScript) ๊ฐ์ฒด(Object)์™€ ๋ฐฐ์—ด(Array) ์•ˆ๋…•ํ•˜์„ธ์š”, ์ด๋ฒˆ ์‹œ๊ฐ„์—๋Š” ์ž๋ฐ”์Šคํฌ๋ฆฝํŠธ ๊ฐ์ฒด(Object)์— ๋Œ€ํ•ด ์•Œ์•„๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. ๊ฐ์ฒด(Object) ๊ฐ์ฒด๋ž€, ํ˜„์‹ค์˜ ์‚ฌ๋ฌผ์„ ํ”„๋กœ๊ทธ๋ž˜๋ฐ์— ๋ฐ˜์˜ํ•œ ๊ฒ๋‹ˆ๋‹ค. ์ฝ”๋“œ๋กœ ๋ณด๋Š”๊ฒŒ ์ดํ•ดํ•˜๊ธฐ ์‰ฝ๊ฒ ์ฃ ? ์ €๋ฅผ ํ”„๋กœ๊ทธ๋ž˜๋ฐ www.zerocho.com ๐Ÿ˜Ž์•Œ๊ฒŒ๋œ ๊ฒƒ๋“ค 1. Array.map()ํ•จ์ˆ˜๋Š” ์„ธ ๊ฐ€์ง€์˜ arguments๋ฅผ ๋ฐ›์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์ฒซ ๋ฒˆ์งธ argument: ์ฒ˜๋ฆฌํ•  ํ˜„์žฌ element ๋‘ ๋ฒˆ์งธ argument: ์ฒ˜๋ฆฌํ•  ํ˜„์ œ ..

1 2 3 4