useSearchParams() should be wrapped in a suspense boundary at page
Answered
Rehan Shaikh posted this in #help-forum
Answered by josh
You'll want to move
useSearchParams()
into an inner component, then wrap that component in <Suspense>
5 Replies
You'll want to move
useSearchParams()
into an inner component, then wrap that component in <Suspense>
Answer
yes , Thanks
I fix this.
great, you can mark it as solved with
Right Click > Apps > Mark Solution
As a note, it looks like what you're doing there can be done in a Server Component. Instead of using
useSearchParams()
(client-only) to get the search params, you can get them like this:export default function Page({
searchParams,
}: {
searchParams?: { sid?: string, order_id?: string};
}) {
return <h1>{searchParams.sid}</h1>;
}