Checks if the code is currently running on the server. Useful for guarding Node-specific logic in Next.js.
true if running on the server, false otherwise.
true
false
if (isServer()) { console.log("This code is running on the server!");} Copy
if (isServer()) { console.log("This code is running on the server!");}
Checks if the code is currently running on the server. Useful for guarding Node-specific logic in Next.js.