We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https://codesandbox.io/p/devbox/naughty-sinoussi-2cz5ks
page.tsx
/[pathParam]/
{params}: {params: { pathParam: string }}
route.ts
I would expect Next.js' params object to behave the same whether it's used from page.tsx, route.ts, or useParams().
params
useParams()
Instead pathParam is undecoded when used from page.tsx and useParams() but is decoded when used from route.ts.
/dynamic-page/%3F%2C%3D%2C%2F%2C%26%2Cшеллы
{ "params": { "pathParam": "%3F%2C%3D%2C%2F%2C%26%2C%D1%88%D0%B5%D0%BB%D0%BB%D1%8B" } }
/dynamic-route/%3F%2C%3D%2C%2F%2C%26%2C%D1%88%D0%B5%D0%BB%D0%BB%D1%8B?
{ "method": "GET", "params": { "pathParam": "?,=,/,&,шеллы" } }
Operating System: Platform: linux Arch: x64 Version: #1 SMP PREEMPT_DYNAMIC Sun Aug 6 20:05:33 UTC 2023 Available memory (MB): 4102 Available CPU cores: 2 Binaries: Node: 20.9.0 npm: 9.8.1 Yarn: 1.22.19 pnpm: 8.10.2 Relevant Packages: next: 14.2.0-canary.11 // There is a newer canary version (14.3.0-canary.21) available, please upgrade! eslint-config-next: N/A react: 18.2.0 react-dom: 18.2.0 typescript: 5.1.3 Next.js Config: output: N/A
Not sure
next dev (local)
No response
The text was updated successfully, but these errors were encountered:
No branches or pull requests
Link to the code that reproduces this issue
https://codesandbox.io/p/devbox/naughty-sinoussi-2cz5ks
To Reproduce
page.tsx
route using a path parameter like/[pathParam]/
and{params}: {params: { pathParam: string }}
route.ts
route using the same path parameter like/[pathParam]/
and{params}: {params: { pathParam: string }}
Current vs. Expected behavior
I would expect Next.js'
params
object to behave the same whether it's used frompage.tsx
,route.ts
, oruseParams()
.Instead pathParam is undecoded when used from
page.tsx
anduseParams()
but is decoded when used fromroute.ts
./dynamic-page/%3F%2C%3D%2C%2F%2C%26%2Cшеллы
/dynamic-route/%3F%2C%3D%2C%2F%2C%26%2C%D1%88%D0%B5%D0%BB%D0%BB%D1%8B?
Provide environment information
Which area(s) are affected? (Select all that apply)
Not sure
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
No response
The text was updated successfully, but these errors were encountered: