Uselayouteffect Ref. Sometimes, you need to measure the current layout to apply