CS391 Lecture 12 Next.js Routing

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/12

flashcard set

Earn XP

Description and Tags

Next.js Routing

Last updated 4:20 AM on 4/25/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

13 Terms

1
New cards

How does Next.js routing work?

Next.js uses file-system routing where folders are routes.

2
New cards

How do you create a route from a folder?

To create a route from a folder you need to nest a page.jsx/tsx in that folder.

3
New cards

Where do you export your React components from?

page.jsx/tsx is also where you would export your React components from

4
New cards

Where are page files rendered?

All page.tsx/jsx files are rendered in the layout.tsx/jsx as {children}.

5
New cards

What happens if I add a style in layout.tsx/jsx?

If I add a style in the layout.tsx/jsx it will be applied to all page.tsx/jsx files.

6
New cards

How are Dynamic paths defined in Next.js?

In React you defined your Dynamic paths in the Root() component but In Next.js your Dynamic paths are defined using brackets [ ]

7
New cards

How do you extract your Dynamic [route]?

To extract your Dynamic [route], you still use useParams()

8
New cards

Can Navigation menu be SSR?

In Next.js your Navigation menu can be SSR as well

9
New cards

What can you do on the CSR side?

Then on the CSR you can map over your Links.

10
New cards

What is usePathname()?

usePathname() can change the theme of the active path and is a Next.js hook that is very similar to use useParams(), except that usePathname() is used to get the entire current path rather that extracting part of it.

11
New cards

Benefits of Server-Side API handling

API Key Protection, Field Exposure, Error Handling

12
New cards

Where should most API keys be stored?

For security, it should be stored in the server (Server-Side).

13
New cards

Where should API_KEY be placed?

It should be placed in the root of the server, in an Environment-Variable file (.env).