icon and onOpen types does not correct (#41439)

* icon and onOpen types does not correct

Icon props in react-leaflet-sidebarv2 check for string or object so icon type must be ReactElement.
onOpen handler must take an id to set selected state.

* Update index.d.ts
This commit is contained in:
Mhammadreza Deljavan
2020-01-16 23:39:43 +03:30
committed by Eli Barzilay
parent 2d96caaff6
commit 72fa663add

View File

@@ -6,7 +6,7 @@
import * as React from 'react';
type Icon = string | React.ElementType;
type Icon = string | React.ReactElement;
type Anchor = 'top' | 'bottom';
type Position = 'left' | 'right';
@@ -33,7 +33,7 @@ interface SidebarProps {
selected: string;
closeIcon?: Icon;
onClose?: () => void;
onOpen?: () => void;
onOpen?: (id: string) => void;
children: TabType;
}