-
Notifications
You must be signed in to change notification settings - Fork 156
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Not Working with Next.js 13 / React 18.2 #196
Comments
I second this. As a workaround I wrap the sniffer in useEffect to trigger it after component has loaded:
Then use as such:
In case it helps anyone out of a squeeze until there's a fix. Cheers Chris |
hope this will help, i put on app/layout.tsx "use client" export default function RootLayout({
} |
@drbarazi u cannot make root layout a client component . The statement form next js beta docs |
Aside from |
+1 following |
@theDanielJLewis @jamesryan-dev found any workaround for this? |
@anoop0567, no. I'm forced into Like this: const [device, setDevice] = useState<string>();
useEffect(() => {
if (isIOS) {
setDevice("ios");
}
if (isMacOs) {
setDevice("macos");
}
if (isAndroid) {
setDevice("android");
}
if (isWindows) {
setDevice("windows");
}
}, []);
return <>{device === "windows" && (<WindowsStuff />)}</>; |
I can't get mine to work even if I copy this code I send |
@anoop0567 i had to make my components client components and useState to handle any react-device-detect work I never found a way to differentiate between tablets ( iPad ) and ios mobile devices which was a shame |
Error: Text content does not match server-rendered HTML.
See more info here: https://nextjs.org/docs/messages/react-hydration-error
import {BrowserView, MobileView, isMobile} from 'react-device-detect'
const Footer = () => {
}
export default Footer;
The text was updated successfully, but these errors were encountered: