xobotyi/react-scrollbars-custom

mobileNative causes page in NextJS to fuddle up during hot reload

stevenmunro opened this issue · 4 comments

I have the Scrollbars HOC wrapping the site. Works well. I may have come across an edge case.

_app.js

<Scrollbar noDefaultStyles noScrollX> <Component {...pageProps} /> </Scrollbar>

If I had mobileNative as a prop, a hot reload in NextJS returns a fuddled up page with native scrollbars. Fuddled up meaning, the page styles appear to inherit elements at the top as if there were a missing closing tag somewhere.

What is the expected behavior?

Adding mobileNative should not affect hot-reload in NextJS.

"next": "^9.4.4",
"react": "^16.13.1",
"react-scrollbars-custom": "^4.0.25",

Can you provide an example? I literally have no idea how could it happen

Hi also get this issue. I have the exact same scenario as @stevenmunro. I have tried providing a true value to mobileNative only for mobile to tablet screen sizes but it doesn't work. I will say that this has only been an issue with Next.js.

Since im not a Next.js user i barely able to fix it without any preconfigured sandbox.

It is not difficult to set up a barebones NextJS project. https://nextjs.org/learn/basics/create-nextjs-app

I believe this has more to do with mobileNative not working in the first instance.