Skip to content

Commit

Permalink
Tweak dropdown prop destructuring to be TypeScript friendly (#38431)
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronrobertshaw authored Feb 3, 2022
1 parent ed96b72 commit 19ffdc4
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions packages/components/src/dropdown/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down

0 comments on commit 19ffdc4

Please sign in to comment.