Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6287

how to check the height of my component with hook ref from react?

$
0
0

I'm trying to check if the height of my button is 50 to display a different spinner but even the height being 50 displays SpinnerTwo, does anyone know the problem?

const refButton = useRef<HTMLButtonElement | null>(null);    <Button ref={refButton} onClick={onClick} >   {ref.current?.clientHeight === 50 ? <SpinnerOne /> : <SpinnerTwo />}</Button>

Viewing all articles
Browse latest Browse all 6287

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>