Skip to content

Commit

Permalink
Merge pull request #620 from jbetancur/fix/596
Browse files Browse the repository at this point in the history
add typing for column.id
  • Loading branch information
jbetancur authored Jul 5, 2020
2 parents 02c88fb + 4bdbb88 commit 3ff3a0c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@
- [Setup](#setup)
- [Local development](#local-development)
- [Including NPM packages](#including-npm-packages)
- [Library dependencies -- <root_dir>/package.**json](#library-dependencies----rootdirpackagejson)
- [Storybook dependencies -- <root_dir>/stories/package.json](#storybook-dependencies----rootdirstoriespackagejson)
- [Library dependencies -- <root_dir>/package.**json](#library-dependencies----root_dirpackagejson)
- [Storybook dependencies -- <root_dir>/stories/package.json](#storybook-dependencies----root_dirstoriespackagejson)
- [Lint](#lint)
- [Test](#test)
- [Build](#build)
Expand Down Expand Up @@ -130,6 +130,7 @@ Nothing new here - we are using an array of object literals and properties to de
| omit | bool | no | omits the column from the table. useful if you need to hide access to data. |
| style | object | no | allows you to customize the css of the cell using css-in-js [style objects](https://www.styled-components.com/docs/advanced#style-objects) |
| conditionalCellStyles | array | no | allows an array of [conditional style objects](#16210-conditional-style-object) to conditionally apply css styles to a cell |
| id | string or number | no | in most cases you should not need to set a column `id` as RDT will auto generate one for each column. However, when developing an SSR app you may encounder an `id did not match` warning. In this case, you can explicitly set the `id` to fix the warning |

#### column.hide media presets

Expand Down
1 change: 1 addition & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ export interface IDataTableProps<T> {
}

export interface IDataTableColumn<T> {
id?: string | number;
name: string | number | React.ReactNode;
selector?: string | ((row: T) => React.ReactNode);
sortable?: boolean;
Expand Down

0 comments on commit 3ff3a0c

Please sign in to comment.