Skip to content

Commit

Permalink
debugging refresh issue
Browse files Browse the repository at this point in the history
  • Loading branch information
enrique-prado committed Oct 7, 2024
1 parent de28250 commit 04348e6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
11 changes: 8 additions & 3 deletions src/components/Table/Table.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import {
} from "components";
import { Button } from "components/Button";
import { useCallback, useEffect, useMemo, useRef, useState } from "react";
import type { Column, Row, TableInstance } from "react-table";
import type { Column, Row } from "react-table";
import { useDebouncedCallback } from "use-debounce";
import type { IconNamesType } from "utils";

Expand Down Expand Up @@ -864,12 +864,14 @@ export const CustomBasicTableFilterDrawer = () => {
setOpenColumnsFilterDrawer(false);
};

const [filtersToApply, setFiltersToApply] = useState([]);
type ColumnFilter = {id: string | null , value: string | number | null };

const [filtersToApply, setFiltersToApply] = useState<ColumnFilter[]>([]);

const handleApply = () => {
const theFilters = [
{ id: "name", value: "Williams" },
{ id: "other", value: "Lorem" },
// { id: "other", value: "Lorem" },
];
setFiltersToApply(theFilters);
closeFilterDrawer();
Expand All @@ -883,6 +885,9 @@ export const CustomBasicTableFilterDrawer = () => {
allowToggleColumnVisibility
data={[...FilledFields.data]}
allFilters={filtersToApply}
// manualColumnFilters
// manualFilters
// manualGlobalFilter
/>
<TableFilterDrawer
title="Custom Table Filter Drawer"
Expand Down
3 changes: 2 additions & 1 deletion src/components/Table/Table.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,8 @@ export const Table = <T extends Record<string, any>>({
} = instance;

useEffect(() => {
console.log(allFilters);
console.log("ping");

setAllFilters(allFilters);
}, [allFilters, setAllFilters]);

Expand Down

0 comments on commit 04348e6

Please sign in to comment.