Runs while the node is attached, right before the composition reuses its component for different content or deactivates it. Drop state tied to the old content; onDetach follows.