Question · Vibe coding with Claude Code course · Module 3: Twitter clone

Reading a dynamic route param

In the page app/post/[id]/page.tsx (Next.js 16, a project without Cache Components), how do you read the id value from the URL?

Answer options

  • From window.id
  • From the params prop: const { id } = await params
  • From useState('id')
  • From an import of 'next/id'

You can check the correct answer by solving this task in the CodeWorlds game.