Next.js · Junior · Question 40 of 75

Why load third-party scripts via next/script?

Explanation

The <Script> component lets you avoid blocking page load with analytics and widgets: beforeInteractive for critical scripts, afterInteractive (the default) and lazyOnload for secondary ones. A script loads once even when navigating between pages.

Further reading

Problem with a question

Next.js · Junior · question 40

Test yourself

Take the Next.js · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz