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.
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.