diff --git a/playground/src/app/home/page.tsx b/playground/src/app/home/page.tsx index aa5adfec..a94b9ba9 100644 --- a/playground/src/app/home/page.tsx +++ b/playground/src/app/home/page.tsx @@ -3,6 +3,7 @@ import AuthInitializer from "@/components/authInitializer" import { isMobile } from "@/common" import dynamic from 'next/dynamic' +import { useEffect, useState } from "react" const PCEntry = dynamic(() => import('@/platform/pc/entry'), { ssr: false, @@ -13,10 +14,16 @@ const MobileEntry = dynamic(() => import('@/platform/mobile/entry'), { }) export default function Home() { + const [mobile, setMobile] = useState(null); + + useEffect(() => { + setMobile(isMobile()) + }) return ( + mobile === null ? <> : - {isMobile() ? : } + {mobile ? : } ); }