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 높이변화' 태그의 글 목록