useRef ๋†’์ด๋ณ€ํ™”

ยท React
๊ธฐ์กด useEffect(() => { const setBoxHeight = () => { if (detailBoxRef.current) { const itemHeight = 4.5; const itemCount = groupedData.reduce((count, group) => count + group.data.length, 0); const calculatedHeight = itemHeight * itemCount + 3 * itemCount; detailBoxRef.current.style.height = `${calculatedHeight}vh`; } }; setBoxHeight(); }, [groupedData, detailBoxRef]); ์ˆ˜์ •ํ›„ useEffect(() => { if (deta..
becky(์ง€์€)
'useRef ๋†’์ด๋ณ€ํ™”' ํƒœ๊ทธ์˜ ๊ธ€ ๋ชฉ๋ก