Skip to content
Discussion options

You must be logged in to vote

Ended up discovering https://github.com/shahradelahi/next-extra for the fix:

From the repo example:

import { pathname, searchParams } from 'next-extra/pathname';

export default async function Layout({
  children,
}: Readonly<{ children: React.ReactNode }>) {
  // Assuming a request to "/hello?name=John"

  const route = pathname(); // /hello
  const params = searchParams(); // ReadonlyURLSearchParams { 'name' => 'John' }

  return children;
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by theogravity
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant