From b47a43c5b07f6f0b4a2fa64d5deb39affd6b91a7 Mon Sep 17 00:00:00 2001 From: Aaron Robertshaw <60436221+aaronrobertshaw@users.noreply.github.com> Date: Wed, 2 Feb 2022 16:24:33 +1000 Subject: [PATCH] Tweak dropdown prop destructuring to be TypeScript friendly --- packages/components/src/dropdown/index.js | 27 ++++++++++++----------- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/packages/components/src/dropdown/index.js b/packages/components/src/dropdown/index.js index 09477a87e0509..d9ebd10fab9ff 100644 --- a/packages/components/src/dropdown/index.js +++ b/packages/components/src/dropdown/index.js @@ -27,19 +27,20 @@ function useObservableState( initialState, onStateChange ) { ]; } -export default function Dropdown( { - renderContent, - renderToggle, - position = 'bottom right', - className, - contentClassName, - expandOnMobile, - headerTitle, - focusOnMount, - popoverProps, - onClose, - onToggle, -} ) { +export default function Dropdown( props ) { + const { + renderContent, + renderToggle, + position = 'bottom right', + className, + contentClassName, + expandOnMobile, + headerTitle, + focusOnMount, + popoverProps, + onClose, + onToggle, + } = props; const containerRef = useRef(); const [ isOpen, setIsOpen ] = useObservableState( false, onToggle );