seamless-scroll-polyfill: Next build not works
i was using old your API for a long time. Now i decided to upd it to 2.1.6
. So I rewrite method windowScrollTo
My code:
import { windowScrollTo } from 'seamless-scroll-polyfill';
<div onClick={handleScroll} className={className}> {children} </div>
and handleScroll
is calculating offsetPosition and scroll in the end:
window && windowScrollTo(window, { top: offsetPosition, behavior: "smooth", });
All is perfect when i check next dev
in Next.js, but it not works, when I use next build
I tryied another methods like windowScroll
or do it in try-catch
or check isWindow
but without success
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 16 (8 by maintainers)
thx again, all works perfect!