From Dev.to
Testing callback ref cleanup on the same DOM node and in TypeScript
A React callback ref can return a cleanup function as well as receive a DOM node. This capability, added in React 19, was tested through ResizeObserver registration and disconnection. Unmounting is on...
