What is the right timing to load i.e. jquery in Next.js?

Viewed 30

When I load jQuery in _document.tsx i.e. via lazyOnload, sometimes browser return It is not loaded popup.

<Script
    src="/themekit/scripts/jquery.min.js"
    strategy="lazyOnload"
/>

Which timing should I choose? Using Next.js: https://nextjs.org/docs/basic-features/script

Maybe I need strategy="beforeInteractive" right? I can not postpone jquery. Or afterInteractive is ok?

0 Answers
Related