Skip to content

Commit

Permalink
Merge pull request nadbm#100 from BluFoot/master
Browse files Browse the repository at this point in the history
account for keyFn prop
  • Loading branch information
nadbm authored Jun 6, 2018
2 parents 6a6fc71 + 593243a commit b007aae
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 b007aae

Please sign in to comment.