Skip to content

Commit 3f54f0d

Browse files
committed
fix(core-filters): default column options
1 parent 4e5c637 commit 3f54f0d

File tree

3 files changed

+10
-26
lines changed

3 files changed

+10
-26
lines changed

examples/column-sizing/src/main.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,7 @@ import ReactDOM from 'react-dom'
33

44
import './index.css'
55

6-
import { createTable, useTable } from '@tanstack/react-table'
7-
import { ColumnResizeMode } from '@tanstack/react-table/build/types/features/ColumnSizing'
6+
import { createTable, useTable, ColumnResizeMode } from '@tanstack/react-table'
87

98
type Person = {
109
firstName: string
@@ -295,13 +294,6 @@ function App() {
295294
)
296295
}
297296

298-
function Test() {
299-
React.useEffect(() => {
300-
console.log('mount')
301-
}, [])
302-
return null
303-
}
304-
305297
ReactDOM.render(
306298
<React.StrictMode>
307299
<App />

examples/pagination/src/main.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,18 +85,10 @@ function App() {
8585
state: {
8686
pagination,
8787
},
88-
onPaginationChange: updater => {
89-
setPagination(old => {
90-
// debugger
91-
const newValue = functionalUpdate(updater, old)
92-
return newValue
93-
})
94-
},
88+
onPaginationChange: setPagination,
9589
paginateRowsFn: paginateRowsFn,
9690
columnFilterRowsFn: columnFilterRowsFn,
9791
debugTable: true,
98-
// debugHeaders: true,
99-
// debugColumns: true,
10092
})
10193

10294
return (

packages/table-core/src/features/Filters.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -132,15 +132,15 @@ export type FiltersInstance<TGenerics extends PartialGenerics> = {
132132

133133
//
134134

135-
export function getDefaultColumn<
136-
TGenerics extends PartialGenerics
137-
>(): FiltersColumnDef<TGenerics> {
138-
return {
139-
filterType: 'auto',
140-
}
141-
}
142-
143135
export const Filters = {
136+
getDefaultColumn: <
137+
TGenerics extends PartialGenerics
138+
>(): FiltersColumnDef<TGenerics> => {
139+
return {
140+
filterType: 'auto',
141+
}
142+
},
143+
144144
getInitialState: (): FiltersTableState => {
145145
return {
146146
columnFilters: [],

0 commit comments

Comments
 (0)