useDebugValue is a Hook and follows the Rules of Hooks, so it should be called consistently at the top level.