main
js 19 lines 424 Bytes
Raw
1 // @validateNoSetStateInEffects @outputMode:"lint"
2 import {useState, useRef, useEffect} from 'react';
3
4 function Tooltip() {
5 const ref = useRef(null);
6 const [tooltipHeight, setTooltipHeight] = useState(0);
7
8 useEffect(() => {
9 const {height} = ref.current.getBoundingClientRect();
10 setTooltipHeight(height);
11 }, []);
12
13 return tooltipHeight;
14 }
15
16 export const FIXTURE_ENTRYPOINT = {
17 fn: Tooltip,
18 params: [],
19 };