Sitemap
Level Up Coding

Coding tutorials and news. The developer homepage gitconnected.com && skilled.dev && levelup.dev

Press enter or click to view image in full size
No Exit Sign
Photo by Matt Seymour on Unsplash

Member-only story

How I Nearly Quit Next.js

My Top 5 Biggest Mistakes

4 min readDec 29, 2023

--

Not a Medium Member? Read for FREE here.

Today I will expand on My Top 5 Biggest Mistakes in hopes of saving you from stepping into puddles filled with countless hours of unnecessary debugging.

These mistakes collectively resulted in hundreds of wasted hours, which nearly made me Quit Next.js.

Without further ado… Lets dive right in.

1. Not Understanding Client-Side And Server-Side Rendering

Having a solid understanding of the nuances between client-side and server-side rendering is paramount for a successful Next.js app.

Broadly speaking…

  • Client-Side Rendering is rendering content on the user’s machine.
  • Server-Side Rendering is rendering static content, then serving this to the client.

Not understanding this difference can be problematic when fetching a session on the client and then conditionally rendering a sign-in or log-out button for example.

Wrong ❌

"use client"

import { useEffect, useState } from "react"
import { IconLogin, IconLogout } from "@tabler/icons-react"
import { Session } from "next-auth/types"

import { auth } from…

--

--