DefinitelyTyped/types/react-sidebar/react-sidebar-tests.tsx
Christopher Deutsch ad30dc660f 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.
2018-05-04 13:50:44 -07:00

22 lines
476 B
TypeScript

import * as React from 'react';
import Sidebar, { SidebarStyles } from 'react-sidebar';
const sidebar = <ul><li>Item 1</li><li>Item 2</li></ul>;
const sidebarStyle: SidebarStyles = {
content: { width: "300px" }
};
const sidebar1 = (
<Sidebar
defaultSidebarWidth={30}
docked={true}
open={true}
sidebar={sidebar}
styles={sidebarStyle}
onSetOpen={(open: boolean) => { }}
>
<h1>Content</h1>
</Sidebar>
);