Add missing open parameter to onSetOpen, which is pretty important if you use it. (#25519)

Add missing `defaultSidebarWidth` prop.

Declare `sidebar` as a more restrictive/accurate type.
This commit is contained in:
Christopher Deutsch
2018-05-04 15:50:44 -05:00
committed by Andy
parent bfb5a55f83
commit ad30dc660f
2 changed files with 6 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
// Type definitions for react-sidebar 2.2
// Type definitions for react-sidebar 2.3
// Project: https://github.com/balloob/react-sidebar#readme
// Definitions by: Jeroen Vervaeke <https://github.com/jeroenvervaeke>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
@@ -8,15 +8,16 @@ import { Component } from "react";
export interface SidebarProps {
contentClassName?: string;
defaultSidebarWidth?: number;
docked?: boolean;
dragToggleDistance?: number;
onSetOpen?(): void;
onSetOpen?(open: boolean): void;
open?: boolean;
overlayClassName?: string;
pullRight?: boolean;
rootClassName?: string;
shadow?: boolean;
sidebar?: any;
sidebar?: React.ReactNode;
sidebarClassName?: string;
styles?: SidebarStyles;
transitions?: boolean;

View File

@@ -9,11 +9,12 @@ const sidebarStyle: SidebarStyles = {
const sidebar1 = (
<Sidebar
defaultSidebarWidth={30}
docked={true}
open={true}
sidebar={sidebar}
styles={sidebarStyle}
onSetOpen={() => {}}
onSetOpen={(open: boolean) => { }}
>
<h1>Content</h1>
</Sidebar>