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

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 6287

Trending Articles