Skip to content

Commit

Permalink
chore: make Column.key as required (#217)
Browse files Browse the repository at this point in the history
  • Loading branch information
nihgwu authored Aug 17, 2020
1 parent 7ac2498 commit 44dd145
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@

## NEXT VERSION

- fix: add types folder into packages
- chore: mark `Column.key` as required

## v1.11.0 (2020-08-17)

- feat: add `ignoreFunctionInColumnCompare` to solve closure problem in renderers
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "react-base-table",
"version": "1.11.1",
"version": "1.11.0",
"description": "a react table component to display large data set with high performance and flexibility",
"main": "lib/index.js",
"module": "es/index.js",
Expand Down
4 changes: 4 additions & 0 deletions src/Column.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,10 @@ export const FrozenDirection = {
class Column extends React.Component {}

Column.propTypes = {
/**
* Unique key for each column
*/
key: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
/**
* Class name for the column cell, could be a callback to return the class name
* The callback is of the shape of `({ cellData, columns, column, columnIndex, rowData, rowIndex }) => string`
Expand Down
3 changes: 3 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ declare module 'react-base-table' {
export type CallOrReturn<T, P = any[]> = T | (P extends any[] ? (...p: P) => T : (p: P) => T);

export interface ColumnShape<T = unknown> {
/**
* Unique key for each column
*/
key: React.Key;
/**
* Class name for the column cell
Expand Down

0 comments on commit 44dd145

Please sign in to comment.