You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Minor bug, but useScrollLock will forever lock in development mode, due to strict mode rerendering useScrollLock, and therefore setting the original state to the body's styling, and then overwriting it to the locking style.
To Reproduce
Create a Next.js project with strict mode on
Use const { lock, unlock } = useScrollLock({ autoLock: false }) in some component like this:
Describe the bug
Minor bug, but
useScrollLock
will forever lock in development mode, due to strict mode rerenderinguseScrollLock
, and therefore setting the original state to the body's styling, and then overwriting it to the locking style.To Reproduce
Create a Next.js project with strict mode on
Use
const { lock, unlock } = useScrollLock({ autoLock: false })
in some component like this:Run
next dev
, and try pressing them
key to toggle the menu.Expected behavior
For
useScrollLock
to not lock the scroll in Strict mode.Additional context
Used Next.js 15.0.0-rc.1,
although I don't see Next.js 14 changing this behavior.EDIT: nope it goes away in Next.js v14 even with Strict mode.The text was updated successfully, but these errors were encountered: