f029023a3c
### What? Adds `useParams` to read the canonical parameters. ```tsx 'use client' import { useParams } from 'next/navigation' export default function Page() { const { id } = useParams() return ( <div> <div id="param-id">{id}</div> </div> ) } ``` ### Why? Allows for accessing segment parameters for the entire page. ### How? It uses a similar resolving of `useSelectedLayoutSegments` which resolve `children` and if `children` is not available the first available parallel route instead. Closes NEXT-99
24 lines
575 B
JSON
24 lines
575 B
JSON
{
|
|
"compilerOptions": {
|
|
"lib": ["dom", "dom.iterable", "esnext"],
|
|
"allowJs": true,
|
|
"skipLibCheck": true,
|
|
"strict": false,
|
|
"forceConsistentCasingInFileNames": true,
|
|
"noEmit": true,
|
|
"incremental": true,
|
|
"esModuleInterop": true,
|
|
"module": "esnext",
|
|
"moduleResolution": "node",
|
|
"resolveJsonModule": true,
|
|
"isolatedModules": true,
|
|
"jsx": "preserve",
|
|
"plugins": [
|
|
{
|
|
"name": "next"
|
|
}
|
|
]
|
|
},
|
|
"include": ["next-env.d.ts", ".next/types/**/*.ts", "**/*.ts", "**/*.tsx"],
|
|
"exclude": ["node_modules"]
|
|
}
|