mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-12 21:10:23 +00:00
Update types for react-sidebar 3.0.0
Added test case to check new properties are optional.
This commit is contained in:
Vendored
+5
-1
@@ -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 <https://github.com/jeroenvervaeke>
|
||||
// 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 {
|
||||
|
||||
@@ -8,6 +8,24 @@ const sidebarStyle: SidebarStyles = {
|
||||
};
|
||||
|
||||
const sidebar1 = (
|
||||
<Sidebar
|
||||
defaultSidebarWidth={30}
|
||||
docked={true}
|
||||
open={true}
|
||||
sidebar={sidebar}
|
||||
styles={sidebarStyle}
|
||||
onSetOpen={(open: boolean) => { }}
|
||||
rootId="test-root-id"
|
||||
sidebarId="test-sidebar-id"
|
||||
contentId="test-content-id"
|
||||
overlayId="test-overlay-id"
|
||||
>
|
||||
<h1>Content</h1>
|
||||
</Sidebar>
|
||||
);
|
||||
|
||||
// Test id properties are optional
|
||||
const sidebar2 = (
|
||||
<Sidebar
|
||||
defaultSidebarWidth={30}
|
||||
docked={true}
|
||||
|
||||
Reference in New Issue
Block a user