When working with Next.js, controlling whether your application renders content on the server-side or client-side can significantly impact its performance and behaviour. Server-side rendering (SSR) can sometimes be unnecessary or less suitable for certain projects, and fortunately, Next.js provides ways to disable SSR when needed. In this blog, … [Continue reading...]
How do you get the current url in Nextjs?
In this blog, we will explore the topic of retrieving the current URL in Next.js, a powerful React framework. Understanding how to obtain the current URL is crucial for various web development scenarios. We'll explore the steps to achieve this and provide real life code examples to get the current url in Nextjs. Getting Started: To kick … [Continue reading...]
How to solve Next.js window is not defined
In Next.js, facing the "window is not defined" error might feel confusing. This error pops up when trying to use the window object in code that runs on the server side. Let's dig into why this happens in Next.js and how to solve for window is not defined: Understanding the Error JavaScript running on the client-side within a browser … [Continue reading...]
Next.js Warning: Extra attributes from the server
This blog post will guide you through the annoying "Extra attributes from the server" warning encountered in Next.js 13 and beyond. We'll explore the causes, multiple solutions, and best practices to keep your development environment clean and free of clutter. Understanding the Warning What is the warning? The warning message … [Continue reading...]
What does colon do in JavaScript & TypeScript?
In JavaScript, the colon (:) serves multiple purposes across different contexts, primarily as a separator and a syntax element within the language. Let's dive into its key roles: Here's a list of the functionalities that a simple colon {:} provides us: 1. Using Colon in the Object Literal Syntax 2. Using Colon in the Ternary … [Continue reading...]
How to redirect to another page in next js
In this tutorial, we will see how to redirect to another page in next js, there are three ways to redirect one page to another page in nextjs. Let's see each option in a detailed way. Using Link Component in Next.JS Using Link component in nextjs it is like a href tag you can just use the href attribute and mention the redirect URL, … [Continue reading...]
How to get the query parameters from URL in Next JS?
In nextjs we can easily get the query params with the use of useRouter() that we can import from 'next/router' then assign userRouter() to the router variable after that using router.query we can get the exact query string values. if you are passing multiple queries also we can get the values from router.query. ☞ Check out Next.js & … [Continue reading...]
Recent Comments