Skip to content

Commit 44dd145

Browse files
authored
chore: make Column.key as required (#217)
1 parent 7ac2498 commit 44dd145

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@
22

33
## NEXT VERSION
44

5+
- fix: add types folder into packages
6+
- chore: mark `Column.key` as required
7+
58
## v1.11.0 (2020-08-17)
69

710
- feat: add `ignoreFunctionInColumnCompare` to solve closure problem in renderers

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "react-base-table",
3-
"version": "1.11.1",
3+
"version": "1.11.0",
44
"description": "a react table component to display large data set with high performance and flexibility",
55
"main": "lib/index.js",
66
"module": "es/index.js",

src/Column.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ export const FrozenDirection = {
2020
class Column extends React.Component {}
2121

2222
Column.propTypes = {
23+
/**
24+
* Unique key for each column
25+
*/
26+
key: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
2327
/**
2428
* Class name for the column cell, could be a callback to return the class name
2529
* The callback is of the shape of `({ cellData, columns, column, columnIndex, rowData, rowIndex }) => string`

types/index.d.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ declare module 'react-base-table' {
1212
export type CallOrReturn<T, P = any[]> = T | (P extends any[] ? (...p: P) => T : (p: P) => T);
1313

1414
export interface ColumnShape<T = unknown> {
15+
/**
16+
* Unique key for each column
17+
*/
1518
key: React.Key;
1619
/**
1720
* Class name for the column cell

0 commit comments

Comments
 (0)