Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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