From 72fa663addeee24abf3704ff8d05e05cb5740a78 Mon Sep 17 00:00:00 2001 From: Mhammadreza Deljavan <31951305+mdeljavan@users.noreply.github.com> Date: Thu, 16 Jan 2020 23:39:43 +0330 Subject: [PATCH] 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 --- types/react-leaflet-sidebarv2/index.d.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/types/react-leaflet-sidebarv2/index.d.ts b/types/react-leaflet-sidebarv2/index.d.ts index b9be2afb0a..692271033b 100644 --- a/types/react-leaflet-sidebarv2/index.d.ts +++ b/types/react-leaflet-sidebarv2/index.d.ts @@ -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; }