Home » Education » How to Import Browser Only Libraries Into Your Next.js Application Using next/dynamic

How to Import Browser Only Libraries Into Your Next.js Application Using next/dynamic

Written By Ado Kukic on Thursday, Aug 27, 2020 | 10:00 AM

 
In this video we'll learn how to import browser only libraries into your Next.js apps. React has traditionally been a SPA framework that runs entirely in the browser so many wrappers for JavaScript libraries that are built around React rely on the browser. Next.js on the other hand treats your app as a server-side app and this can cause issues when importing certain browser or client-only libraries. Luckily, the Next.js team has a great solution for how to get around this with the next/dynamic package.