mirror of
https://github.com/hanzoai/next.js.git
synced 2026-09-24 17:00:51 +00:00
## What? Ensures `useParams` matches `params` passed to the page, also matches the docs. Fixes #50856 Fixes NEXT-1419
14 lines
261 B
TypeScript
14 lines
261 B
TypeScript
'use client'
|
|
import { useParams } from 'next/navigation'
|
|
export default function Page() {
|
|
const params = useParams()
|
|
if (params === null) {
|
|
return null
|
|
}
|
|
return (
|
|
<div>
|
|
<div id="params">{JSON.stringify(params.path)}</div>
|
|
</div>
|
|
)
|
|
}
|