From 8bf901b5412077aca7cd098936a6d899330763a3 Mon Sep 17 00:00:00 2001 From: Matt Walters Date: Mon, 6 Jul 2020 14:12:45 -0500 Subject: [PATCH] fix: ensuring consistent interface for scrollToId --- index.d.ts | 2 +- src/UnstableFastTree.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/index.d.ts b/index.d.ts index 7c0e6e5..5c214c4 100644 --- a/index.d.ts +++ b/index.d.ts @@ -38,7 +38,7 @@ export interface TreeProps { children: (props: RendererProps) => JSX.Element; nodeMarginLeft?: number; width?: number; - scrollToId?: number; + scrollToId?: NodeId; scrollToAlignment?: string; } diff --git a/src/UnstableFastTree.js b/src/UnstableFastTree.js index 47bcbda..ce02017 100644 --- a/src/UnstableFastTree.js +++ b/src/UnstableFastTree.js @@ -52,7 +52,7 @@ UnstableFastTree.propTypes = { children: PropTypes.func.isRequired, nodeMarginLeft: PropTypes.number, width: PropTypes.number, - scrollToId: PropTypes.number, + scrollToId: PropTypes.oneOfType([ PropTypes.string, PropTypes.number]), }; UnstableFastTree.defaultProps = {