Skip to content
New issue

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

Server component won't re-render when deleting all search params #64978

Open
georgesofianosgr opened this issue Apr 24, 2024 · 0 comments
Open
Labels
bug Issue was opened via the bug report template.

Comments

@georgesofianosgr
Copy link

Link to the code that reproduces this issue

https://codesandbox.io/p/devbox/elastic-sun-s3d7mt

To Reproduce

  1. Visit the link of the app with the search param fruit with a value, eg https://s3d7mt-3000.csb.app?fruit=apple
  2. Click the reset button that navigates user back to index page without search params, eg https://s3d7mt-3000.csb.app/

The page wont re-render.

Current vs. Expected behavior

In nextjs 14.1.1 if I remove all the search params the page will re-render.
In nextjs 14.2.2 and [email protected] the page won't re-render after removing the search params.
That only happens if you visit the page with search params from the start.

Our current workaround is to after pushing the page when there are not search params is to do router.refresh().

Provide environment information

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.3.0-canary.21 // Latest available version is detected (14.3.0-canary.21).
  eslint-config-next: 14.1.0
  react: 18.2.0
  react-dom: 18.2.0
  typescript: 5.3.3
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Not sure

Which stage(s) are affected? (Select all that apply)

next dev (local), next start (local)

Additional context

No response

@georgesofianosgr georgesofianosgr added the bug Issue was opened via the bug report template. label Apr 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Issue was opened via the bug report template.
Projects
None yet
Development

No branches or pull requests

1 participant