useSearchParams() should be wrapped in a suspense boundary at page
Answered
Asiatic Lion posted this in #help-forum
Asiatic LionOP
npm run build , Next 14.1
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
Asiatic LionOP
yes , Thanks
I fix this.
great, you can mark it as solved with
Right Click > Apps > Mark SolutionAs 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>;
}