In the following image you can see some technical details of how the new possibility of using Cleanup Functions for ref works in the React 19 library:

In the following image you can see some technical details of how the new possibility of using Cleanup Functions for ref works in the React 19 library: