Describe the bug
As a follow up to #3695 and #3696 - in the same reproduction if we replace the ref with a function we are calling it in the wrong order. We first call it with the div and then with the unmounted null.
To Reproduce
I have already added a test which shows the issue
Expected behavior
We expect the unmounted element to cleanup the ref and then the refto be called with the new element.
Describe the bug
As a follow up to #3695 and #3696 - in the same reproduction if we replace the ref with a function we are calling it in the wrong order. We first call it with the div and then with the unmounted null.
To Reproduce
I have already added a test which shows the issue
Expected behavior
We expect the unmounted element to cleanup the ref and then the refto be called with the new element.