How to detect the device on React SSR App with Next.js?
问题 on a web application I want to display two different Menu, one for the Mobile, one for the Desktop browser. I use Next.js application with server-side rendering and the library react-device-detect. Here is the CodeSandox link. import Link from "next/link"; import { BrowserView, MobileView } from "react-device-detect"; export default () => ( <div> Hello World.{" "} <Link href="/about"> <a>About</a> </Link> <BrowserView> <h1> This is rendered only in browser </h1> </BrowserView> <MobileView>