Skip to content

Add example for Next.JS client-side pagesΒ #516

@neilenns

Description

@neilenns

Thank you for the amazing hook, it was so fast to get this up and running with my table.

Since I'm using client-side rendering for the page I had to make a few changes to the example in the docs. Perhaps the docs can update to include a client-side example?

Here's how I got it working:

import { usePathname, useRouter, useSearchParams } from "next/navigation";

const router = useRouter();

const stateAndOnChanges = useTableSearchParams({
  query: useSearchParams(),
  pathname: usePathname(),
  replace: router.replace,
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions