vercel / vercel/next-learn

Chapter 11: Updating the table(11.4)

Open
#647 1 comment 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
4.8k
Forks
2.2k
PR merge metrics
No merged PRs in 30d

Description

Instead of:

/*
export default async function Page({
searchParams,
}: {
searchParams?: {
query?: string;
page?: string;
};
}) {
const query = searchParams?.query || '';
const currentPage = Number(searchParams?.page) || 1;
*/

// Which throws an error

//Solution:

interface SearchParams {
query?: string;
page?: string;
}

export default async function Page({ searchParams }: { searchParams?: SearchParams }) {
const query = searchParams?.query || '';
const currentPage = Number(searchParams?.page) || 1;

// Error Screenshot
image

// After implementing Solution
image

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with Chapter 11 and table 11.4, comparing the displayed Page example with the provided SearchParams-based solution. Update the chapter content so the example uses the working searchParams typing, then verify that it matches the post-fix behavior shown in the issue.

Written by the indexing model from the issue text.

Assessment

Tech stack
next.js, typescript
Domain
documentation
Issue type
Documentation
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.