You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functionTooltip(){constref=useRef(null);const[tooltipHeight,setTooltipHeight]=useState(0);// You don't know real height yetuseLayoutEffect(()=>{const{ height }=ref.current.getBoundingClientRect();setTooltipHeight(height);// Re-render now that you know the real height},[]);// ...use tooltipHeight in the rendering logic below...}
Reproduction
No response
Expected behavior
No response
Platform and versions
"@eslint-react/eslint-plugin": "^1.14.3"
Stack trace
No response
Additional context
No response
The text was updated successfully, but these errors were encountered:
Describe the bug
This is the official use case in the React docs, you cannot do it another way.
https://react.dev/reference/react/useLayoutEffect
Reproduction
No response
Expected behavior
No response
Platform and versions
Stack trace
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: