Set the ref prop on the element. · In the useLayoutEffect hook, update the state variables for the width and height. · Use the offsetWidth ...
確定! 回上一頁