Skip to content

Commit dc3a2a4

Browse files
docs: add accessorFn requirement for column sorting (#119)
1 parent 6824bcc commit dc3a2a4

4 files changed

Lines changed: 8 additions & 0 deletions

File tree

README-ru.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ const data: Person[] = [
9797
const SortingExample = () => {
9898
const [sorting, setSorting] = React.useState<SortingState>([]);
9999

100+
// Ваша колонка ДОЛЖНА иметь accessorFn для включения сортировки
101+
100102
const table = useTable({
101103
columns,
102104
data,

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,8 @@ const data: Person[] = [
9797
const SortingExample = () => {
9898
const [sorting, setSorting] = React.useState<SortingState>([]);
9999

100+
// Your column MUST have accessorFn for sorting to be enabled
101+
100102
const table = useTable({
101103
columns,
102104
data,

src/components/BaseTable/__stories__/stories/SortingStory.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import {data} from '../constants/data';
1010
export const SortingStory = () => {
1111
const [sorting, setSorting] = React.useState<SortingState>([]);
1212

13+
// Your column MUST have accessorFn for sorting to be enabled
14+
1315
const table = useTable({
1416
columns,
1517
data,

src/components/Table/__stories__/stories/SortingStory.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ import './SortingStory.scss';
1515
export const SortingStory = () => {
1616
const [sorting, setSorting] = React.useState<SortingState>([]);
1717

18+
// Your column MUST have accessorFn for sorting to be enabled
19+
1820
const table = useTable({
1921
columns,
2022
data,

0 commit comments

Comments
 (0)