Created
May 23, 2024 10:31
-
-
Save p32929/ae56c53479376059833671790f7cf140 to your computer and use it in GitHub Desktop.
disable SSR on a component
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import dynamic from 'next/dynamic' | |
import React from 'react' | |
const NoSsr = props => ( | |
<React.Fragment>{props.children}</React.Fragment> | |
) | |
export default dynamic(() => Promise.resolve(NoSsr), { | |
ssr: false | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
how to use: