Replies: 1 comment
-
The primary benefit of I would look into Suspense though. It does seem that you could pass page's |
Beta Was this translation helpful? Give feedback.
-
The primary benefit of I would look into Suspense though. It does seem that you could pass page's |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Goals
"use client"
and calluseParams()
oruseSearchParams()
to achieve this behaviorNon-Goals
Background
This feature is needed because it's hard to believe it doesn't already. When you learn how the
page.js
anddefault.js
file conventions work, they get rendered after the initial request which contains the URL so they can receive these props, but, so does loading.js so I expected it to be able to receive these props as well.Currently, the way you have to get around this is by marking the file as
"use client"
and then using theusePathname()
oruseSearchParams()
hooks to read thoseparams
. These are extra steps that shouldn't have to be taken, it also isn't ideal for aloading.js
file to be a client component, for this use case theloading.js
file being a client component should be completely unnecessary and causes for unnecessary hydration when it should be able to read theseparams
by default.Proposal
Allow
loading.js
file to acceptparams
andsearchParams
Beta Was this translation helpful? Give feedback.
All reactions