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

Get notified when ref.current changes in React

$
0
0

Is there a way to get notified when ref.current changes in React ? Like the code below.

const ref = useRef(0);// pseudo coderef.addCallback((newValue)=> {  // notified});ref.current = 1; // triggers the notification.

Viewing all articles
Browse latest Browse all 6423

Trending Articles



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