#Easy way to disable SSR?
1 messages · Page 1 of 1 (latest)
One way is to use dynamic from "next/dynamic":
import dynamic from "next/dynamic"
const YourPage = () => {...}
export default dynamic(() => Promise.resolve(YourPage), {
ssr: false,
})
You can also check if window is defined and render stuff based on it:
const isSSR = () => typeof window === ‘undefined’;
And there's also react-no-ssr package that you can check out.