๋ฐ˜์‘ํ˜•

front end 3

[Html] select element ์—์„œ dropdown icon ๋ฐ”๊พธ๋Š” ๋ฐฉ๋ฒ•

Intro์•ˆ๋…•ํ•˜์„ธ์š”. select element ์—์„œ dropdown icon ๋ฐ”๊พธ๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด ์•Œ์•„๋ณด๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค :)  How to solve problem Option 1 Option 2 Option 3/* Hide the default dropdown arrow */.custom-select { appearance: none; /* For Firefox */ -webkit-appearance: none; /* For Chrome, Safari, Opera */ -moz-appearance: none; /* For Firefox */ background-image: url('custom-dropdown-icon.png'); /* Custom arrow icon */ backgrou..

Programming/Html 2024.04.23

[ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค/JS] ์ค‘์•™๊ฐ’ ๊ตฌํ•˜๊ธฐ

Problem Description ์ค‘์•™๊ฐ’์€ ์–ด๋–ค ์ฃผ์–ด์ง„ ๊ฐ’๋“ค์„ ํฌ๊ธฐ์˜ ์ˆœ์„œ๋Œ€๋กœ ์ •๋ ฌํ–ˆ์„ ๋•Œ ๊ฐ€์žฅ ์ค‘์•™์— ์œ„์น˜ํ•˜๋Š” ๊ฐ’์„ ์˜๋ฏธํ•ฉ๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด 1, 2, 7, 10, 11์˜ ์ค‘์•™๊ฐ’์€ 7์ž…๋‹ˆ๋‹ค. ์ •์ˆ˜ ๋ฐฐ์—ด array๊ฐ€ ๋งค๊ฐœ๋ณ€์ˆ˜๋กœ ์ฃผ์–ด์งˆ ๋•Œ, ์ค‘์•™๊ฐ’์„ return ํ•˜๋„๋ก solution ํ•จ์ˆ˜๋ฅผ ์™„์„ฑํ•ด๋ณด์„ธ์š”. Restrictions. array์˜ ๊ธธ์ด๋Š” ํ™€์ˆ˜์ž…๋‹ˆ๋‹ค. 0 < array์˜ ๊ธธ์ด < 100 -1,000

[React] React Hook "useSelector" cannot be called inside a callback ์—๋Ÿฌ ๋ฐ ํ•ด๊ฒฐ ๋ฐฉ๋ฒ•

Intro ์•ˆ๋…•ํ•˜์„ธ์š”. react hook useSelector ๋ฅผ ์‚ฌ์šฉํ•˜๋˜ ๋„์ค‘ ์•„๋ž˜์˜ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ์Šต๋‹ˆ๋‹ค. React Hook "useSelector" cannot be called inside a callback function YourComponent() { useEffect(() => { useSelector((state: RootState) => state.code[SOME_DATA]) }, []) } Why? react hook์„ ์‚ฌ์šฉํ•  ๋•Œ๋Š” ์ค‘์š”ํ•œ 2๊ฐ€์ง€ ๊ทœ์น™์ด ์žˆ์Šต๋‹ˆ๋‹ค. 1๏ธโƒฃ Only Call Hooks at the Top Level ๋ฃจํ”„ ์กฐ๊ฑด ๋˜๋Š” ์ค‘์ฒฉ๋œ ํ•จ์ˆ˜ ๋‚ด์—์„œ Hooks๋ฅผ ํ˜ธ์ถœํ•  ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค. ํ•ญ์ƒ React ํ•จ์ˆ˜์˜ Top Level์—์„œ Hooks๋ฅผ ์‚ฌ์šฉํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ์ด ๊ทœ์น™์„..

Framework/React 2023.09.18
๋ฐ˜์‘ํ˜•