mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-02 06:29:40 +08:00
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:
committed by
Andy
parent
bfb5a55f83
commit
ad30dc660f
7
types/react-sidebar/index.d.ts
vendored
7
types/react-sidebar/index.d.ts
vendored
@@ -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;
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user