rsnext/test/e2e/app-dir/use-params/tsconfig.json
Tim Neutkens f029023a3c
Add useParams() (#47373)
### 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
2023-03-22 09:26:19 +00:00

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"]
}