Skip to content

Commit

Permalink
docs: Fix columHelper typo. (#4256)
Browse files Browse the repository at this point in the history
  • Loading branch information
aidanCQ committed Aug 2, 2022
1 parent 2d37b51 commit 2cb4b7a
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions docs/guide/column-defs.md
Expand Up @@ -136,7 +136,7 @@ You could extract the `firstName` value like so:
```tsx

columHelper.accessor('firstName')
columnHelper.accessor('firstName')

// OR

Expand All @@ -156,7 +156,7 @@ type Sales = [Date, number]
You could extract the `number` value like so:
```tsx
columHelper.accessor(1)
columnHelper.accessor(1)

// OR

Expand All @@ -183,7 +183,7 @@ type Person = {
You could extract a computed full-name value like so:
```tsx
columHelper.accessor(row => `${row.firstName} ${row.lastName}`, {
columnHelper.accessor(row => `${row.firstName} ${row.lastName}`, {
id: 'fullName',
})

Expand Down Expand Up @@ -224,15 +224,15 @@ There are a couple of formatters available to you:
You can provide a custom cell formatter by passing a function to the `cell` property and using the `props.getValue()` function to access your cell's value:

```tsx
columHelper.accessor('firstName', {
columnHelper.accessor('firstName', {
cell: props => <span>{props.getValue().toUpperCase()}</span>,
})
```

Cell formatters are also provided the `row` and `table` objects, allowing you to customize the cell formatting beyond just the cell value. The example below provides `firstName` as the accessor, but also displays a prefixed user ID located on the original row object:

```tsx
columHelper.accessor('firstName', {
columnHelper.accessor('firstName', {
cell: props => (
<span>{`${props.row.original.id} - ${props.getValue()}`}</span>
),
Expand Down

0 comments on commit 2cb4b7a

Please sign in to comment.