Just to mark this answered,
Instead of using the hook to handle the switching of UI i simply the condition directly inside the page.ts
async function Page() {
const data = await getSomeData();
const isMobile = customFunctionToPrseUserAgent()
if (isMobile) return <>UI FOR MOBILE</>
return NORMAL UI
}