3 Ways to Set Background Image in Next.js
This succinct, practical article will show you some different ways to set an image background in Next.js 13 and above (with the /app directory). Without any further ado…
Next.js Warning: Extra attributes from the server [solved]
This concise and straight-to-the-point article will show you some different ways to get rid of an annoying warning that often shows up in your console when working with…
Next.js: 2 ways to get the current route’s path
In this article, Sling Academy will show you 2 distinct ways to get the URL path of the current route in Next.js 13 or a later version of…
Solving Next.js error: NextRouter was not mounted
This concise article shows you how to fix a common error related to NextRouter in Next.js The Problem When working with Next.js 13 or a newer version of…
Next.js: How to Extract Request Headers (4 Approaches)
This article shows you a couple of different ways to extract request headers in Next.js (we will focus on Next.js 13 and use TypeScript in the upcoming examples)….
Next.js Error: Hooks are not Allowed in Server Components
The problem When working with a new version of Next.js (13.x or higher) and using the app directory instead of the traditional pages directory, you might run into…
How to Import & Display Local Images in Next.js
When developing web apps with Next.js, there might be cases where you want to import and use local images instead of network images, such as logos, placeholders, download…
Next.js: Using getServerSideProps() with TypeScript
Overview In Next.js, the getServerSideProps() function is a way to fetch data on the server side and pass it as props to your page component. It is useful…
Next.js: How to organize code in an “src” folder
By default, Next.js puts your pages folder in the root directory of your project. However, you can store your source code (including pages, components, CSS styles, and utility…
Next.js getServerSideProps(): Tutorial & Example
Overview getServerSideProps() is a Next.js asynchronous function that can be exported from a page component (in your pages folder) to fetch data at the requested time on the…