Skip to content

Commit

Permalink
fix(DropdownMenu): remove defaultProps (#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
kyletsang authored May 8, 2024
1 parent ba3d534 commit 42943d8
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/DropdownMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,10 +176,6 @@ export function useDropdownMenu(options: UseDropdownMenuOptions = {}) {
return [menuProps, metadata] as const;
}

const defaultProps = {
usePopper: true,
};

export interface DropdownMenuProps extends UseDropdownMenuOptions {
/**
* A render prop that returns a Menu element. The `props`
Expand Down Expand Up @@ -214,15 +210,20 @@ export interface DropdownMenuProps extends UseDropdownMenuOptions {
* @displayName DropdownMenu
* @memberOf Dropdown
*/
function DropdownMenu({ children, ...options }: DropdownMenuProps) {
const [props, meta] = useDropdownMenu(options);
function DropdownMenu({
children,
usePopper: usePopperProp = true,
...options
}: DropdownMenuProps) {
const [props, meta] = useDropdownMenu({
...options,
usePopper: usePopperProp,
});

return <>{children(props, meta)}</>;
}

DropdownMenu.displayName = 'DropdownMenu';

DropdownMenu.defaultProps = defaultProps;

/** @component */
export default DropdownMenu;

0 comments on commit 42943d8

Please sign in to comment.