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

First render default values vs URL values #637

Open
ljrodriguez1 opened this issue Sep 12, 2024 · 1 comment
Open

First render default values vs URL values #637

ljrodriguez1 opened this issue Sep 12, 2024 · 1 comment
Labels
bug Something isn't working router:pages Uses the Next.js pages router

Comments

@ljrodriguez1
Copy link

Context

What's your version of nuqs?

"nuqs": "^1.19.1",

Next.js information (obtained by running next info):

Operating System:
  Platform: linux
  Arch: x64
  Version: #1 SMP Fri Mar 29 23:14:13 UTC 2024
  Available memory (MB): 7643
  Available CPU cores: 16
Binaries:
  Node: 20.14.0
  npm: 10.8.1
  Yarn: N/A
  pnpm: N/A
Relevant Packages:
  next: 14.2.5 // There is a newer version (14.2.10) available, upgrade recommended!
  eslint-config-next: N/A
  react: 18.3.1
  react-dom: 18.3.1
  typescript: 5.5.4
Next.js Config:
  output: N/A
 ⚠ There is a newer version (14.2.10) available, upgrade recommended!
   Please try the latest canary version (`npm install next@canary`) to confirm the issue still exists before creating a new issue.
   Read more - https://nextjs.org/docs/messages/opening-an-issue

Are you using:

  • ❌ The app router
  • ✅ The pages router
  • ❌ The basePath option in your Next.js config
  • ❌ The experimental windowHistorySupport flag in your Next.js config

Description

I have notice that when using default values on the first render of a client only component the state is filled with the default values, then it seems to load the url values and change the state. This causes problems in my app. Is there a way to know when the url params have been loaded and the state is up to date?

@ljrodriguez1 ljrodriguez1 added the bug Something isn't working label Sep 12, 2024
@franky47
Copy link
Member

Is this a duplicate of #290, or a different case? Could you share the code you are using to make that component "client only" please?

@franky47 franky47 added the router:pages Uses the Next.js pages router label Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working router:pages Uses the Next.js pages router
Projects
None yet
Development

No branches or pull requests

2 participants