From f327f7cc69056f11ca2166ceeb6ac5d565230d9e Mon Sep 17 00:00:00 2001 From: Robin Luiten Date: Tue, 7 Aug 2018 20:47:16 +1000 Subject: [PATCH] Update types for react-sidebar 3.0.0 Added test case to check new properties are optional. --- types/react-sidebar/index.d.ts | 6 +++++- types/react-sidebar/react-sidebar-tests.tsx | 18 ++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/types/react-sidebar/index.d.ts b/types/react-sidebar/index.d.ts index 1aec2497da..562398d4a5 100644 --- a/types/react-sidebar/index.d.ts +++ b/types/react-sidebar/index.d.ts @@ -1,4 +1,4 @@ -// Type definitions for react-sidebar 2.3 +// Type definitions for react-sidebar 3.0 // Project: https://github.com/balloob/react-sidebar#readme // Definitions by: Jeroen Vervaeke // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped @@ -23,6 +23,10 @@ export interface SidebarProps { transitions?: boolean; touch?: boolean; touchHandleWidth?: number; + rootId?: string; + sidebarId?: string; + contentId?: string; + overlayId?: string; } export interface SidebarStyles { diff --git a/types/react-sidebar/react-sidebar-tests.tsx b/types/react-sidebar/react-sidebar-tests.tsx index caeaa3c37d..e1f4374284 100644 --- a/types/react-sidebar/react-sidebar-tests.tsx +++ b/types/react-sidebar/react-sidebar-tests.tsx @@ -8,6 +8,24 @@ const sidebarStyle: SidebarStyles = { }; const sidebar1 = ( + { }} + rootId="test-root-id" + sidebarId="test-sidebar-id" + contentId="test-content-id" + overlayId="test-overlay-id" + > +

Content

+
+); + +// Test id properties are optional +const sidebar2 = (