Skip to content

Commit aa294c6

Browse files
Update next-basics.md
1 parent 6ad9a23 commit aa294c6

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

next-basics.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ Next.js is a React framework built on top of React that provides:
5656

5757
- **API routes** to build backend endpoints in the same project — Files inside `app/api/` export HTTP handler functions (`GET`, `POST`, etc.), allowing you to write backend logic without a separate server. Ideal for form submissions, webhooks, and database queries.
5858

59-
- **Automatic code splitting** per page — Next.js only sends the JavaScript needed for the current page. Users don't download code for routes they haven't visited, resulting in faster initial load times.
59+
- **Automatic code splitting** per page — Next.js only sends the JavaScript needed for the current page. Users don\'t download code for routes they haven\'t visited, resulting in faster initial load times.
6060

6161
- **Built-in image optimization** via `next/image` — The `<Image>` component automatically resizes, compresses, converts to modern formats (WebP/AVIF), and lazy-loads images. This eliminates the manual work of optimizing assets for different screen sizes.
6262

@@ -748,7 +748,7 @@ These hooks are Client Component hooks ("`use client`") imported from `next/navi
748748

749749
**1. usePathname**
750750

751-
Reads the current URL's path name (the string after the domain name, excluding query parameters).
751+
Reads the current URL\'s path name (the string after the domain name, excluding query parameters).
752752

753753
* **URL Example**: `https://example.com`
754754
* **Returned Value**: `"/dashboard/settings"` (as a string)
@@ -2608,7 +2608,7 @@ export function RoleBadge() {
26082608

26092609
## Q. How do you implement geolocation-based routing in Next.js Middleware?
26102610

2611-
Next.js Middleware on Vercel automatically populates `request.geo` with the visitor's country, region, and city, derived from the request IP — no extra library needed.
2611+
Next.js Middleware on Vercel automatically populates `request.geo` with the visitor\'s country, region, and city, derived from the request IP — no extra library needed.
26122612

26132613
```ts
26142614
// middleware.ts
@@ -2873,7 +2873,7 @@ export const runtime = 'edge';
28732873

28742874
## Q. How do you containerize a Next.js app with Docker?
28752875

2876-
To containerize a Next.js app with Docker, the best practice is to utilize multi-stage builds and Next.js's built-in **standalone output**. This approach creates a self-contained, minimal Node.js server rather than copying your entire `node_modules` folder, shrinking the final image size from over 1GB to roughly 170MB
2876+
To containerize a Next.js app with Docker, the best practice is to utilize multi-stage builds and Next.js\'s built-in **standalone output**. This approach creates a self-contained, minimal Node.js server rather than copying your entire `node_modules` folder, shrinking the final image size from over 1GB to roughly 170MB
28772877

28782878
**Step 1: Configure Next.js for Standalone Output**
28792879

@@ -3158,7 +3158,7 @@ import { cacheLife } from 'next/cache';
31583158
import { db } from '@/lib/db';
31593159

31603160
export async function getProductDetails(productId: string) {
3161-
'use cache'; // Caches just this function's output
3161+
'use cache'; // Caches just this function\'s output
31623162
cacheLife('minutes'); // Automatically revalidates every few minutes
31633163

31643164
return await db.product.findUnique({ where: { id: productId } });

0 commit comments

Comments
 (0)