When React removes a referenced DOM element, it clears the managed reference by setting ref.current to null.