From 593243abba6adf72a1fdfe4288be5c544c64fd6c Mon Sep 17 00:00:00 2001 From: acornellier Date: Tue, 5 Jun 2018 15:13:27 -0400 Subject: [PATCH] account for keyFn prop --- src/DataSheet.js | 3 ++- types/react-datasheet.d.ts | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/DataSheet.js b/src/DataSheet.js index f1eb04a..ce19516 100644 --- a/src/DataSheet.js +++ b/src/DataSheet.js @@ -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 = { diff --git a/types/react-datasheet.d.ts b/types/react-datasheet.d.ts index 93b5f84..3d84902 100644 --- a/types/react-datasheet.d.ts +++ b/types/react-datasheet.d.ts @@ -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. */