Skip to content

Commit

Permalink
account for keyFn prop
Browse files Browse the repository at this point in the history
  • Loading branch information
acornellier committed Jun 5, 2018
1 parent 216e331 commit 593243a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/DataSheet.js
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,8 @@ DataSheet.propTypes = {
valueViewer: PropTypes.func,
dataEditor: PropTypes.func,
parsePaste: PropTypes.func,
attributesRenderer: PropTypes.func
attributesRenderer: PropTypes.func,
keyFn: PropTypes.func
}

DataSheet.defaultProps = {
Expand Down
2 changes: 2 additions & 0 deletions types/react-datasheet.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ declare namespace ReactDataSheet {
selected?: Selection | null;
/** Optional. Calls the function whenever the user changes selection**/
onSelect?: (selection: Selection) => void;
/** Optional. Function to set row key. **/
keyFn?: (row: number) => number;
}

/** A function to process the raw clipboard data. It should return an array of arrays of strings. This is useful for when the clipboard may have data with irregular field or line delimiters. If not set, rows will be split with line breaks and cells with tabs. To wire it up pass your function to the parsePaste property of the ReactDataSheet component. */
Expand Down

0 comments on commit 593243a

Please sign in to comment.