React manages DOM refs during the commit phase. It assigns the node when the element mounts and clears the reference by assigning null when the element unmounts.