Skip to content

Add support for other routers #620

Answered by franky47
vanenshi asked this question in Ideas
Discussion options

You must be logged in to vote

I have opened a draft PR implementing adapters in #644. You can try a preview here (here be dragons):

pnpm add https://pkg.pr.new/nuqs@644

You'll need to wrap your application in a NuqsAdapter, as such:

Vanilla React (eg: with Vite):

import { NuqsAdapter } from 'nuqs/adapters/react'

createRoot(document.getElementById('root')!).render(
  <NuqsAdapter>
    <App />
  </NuqsAdapter>
)

Next.js, app router:

// src/app/layout.tsx
import { NuqsAdapter } from 'nuqs/adapters/next'
import { type ReactNode } from 'react'

export default function RootLayout({
  children
}: {
  children: ReactNode
}) {
  return (
    <html>
      <body>
        <NuqsAdapter>{children}</NuqsAdapter>
      </body>
    </

Replies: 1 comment 9 replies

Comment options

You must be logged in to vote
9 replies
@franky47
Comment options

@Talent30
Comment options

@franky47
Comment options

@franky47
Comment options

Answer selected by vanenshi
@vanenshi
Comment options

@franky47
Comment options

@EfstathiadisD
Comment options

@franky47
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
4 participants