TanStackT
TanStack2y ago
44 replies
safe-amethyst

Global Filtering not working

Everything else is working...

  const [globalFilter, setGlobalFilter] = useState("");
  const [pagination, setPagination] = useState({
    pageIndex: 0,
    pageSize: 3,
  });

  useEffect(() => {
    console.log("Global filter changed to:", globalFilter); // works
  }, [globalFilter]);

  const tableInstance = useReactTable({
    columns,
    data: sitemapUrls || [],
    getCoreRowModel: getCoreRowModel(),
    getPaginationRowModel: getPaginationRowModel(),
    onPaginationChange: setPagination,
    getFilteredRowModel: getFilteredRowModel(),
    onGlobalFilterChange: setGlobalFilter,
    state: {
      pagination,
      globalFilter,
    },
  });
Was this page helpful?