useTransition is a Hook, so it follows the Rules of Hooks and should be called at the top level of a component or another Hook.