Skip to content
Discussion options

You must be logged in to vote

This is a known behavior with Next.js build-time detection. When components are passed as props, the static analysis can't detect useSearchParams() usage at build time.

Why this happens:

  • Case A: Direct component usage - Next.js can statically analyze and detect useSearchParams()
  • Case B: Component passed as prop - Static analysis fails to detect the hook usage

Solutions:

  1. Add Suspense boundary manually in case B:
export function B() {
  return (
    <Suspense fallback={<div>Loading...</div>}>
      <TableLayout
        searchSection={<SearchBar />}
        tableSection={<DataTable />}
      />
    </Suspense>
  );
}

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@hyonun321
Comment options

Answer selected by hyonun321
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants