Home
Basics
Introduction Environment setup Project structure Pages CSS in NextJS JavaScript in NextJS Layouts Data Fetching Routing API Routes Metadata and SEO Environment Variables OptimizationsAdvanced
Dynamic Importing Blog using md files Authentication in NextJS Mongodb and NextJS Stripe and NextJSMiscellaneous
Deploying NextJS app on Heroku NextJS Templates NextJS Interview QnALoading external JS in NextJS
To load the external JS files, you can use "Script" component from 'next/script'
import Script from 'next/script'
<Script src="https://xyz.com/abc.js" strategy="lazyOnload" />
Loading strategies are mentioned below.- afterInteractive - load after page become interactive
- beforeInteractive - load critical scripts before page is interactive - should be put in _document.js
- lazyOnload - load during idle time
- worker - load in a web worker
Web development and Automation testing
solutions delivered!!