chore(ui-toolkit): remove forwardRef as refs weren't being passed (#4160)

This commit is contained in:
Matthew Russell 2023-06-23 15:36:21 -07:00 committed by GitHub
parent fc047feeee
commit 13f2e51798
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,6 +1,6 @@
import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu'; import * as DropdownMenuPrimitive from '@radix-ui/react-dropdown-menu';
import classNames from 'classnames'; import classNames from 'classnames';
import type { ReactNode } from 'react'; import type { ComponentProps, ReactNode } from 'react';
import { forwardRef } from 'react'; import { forwardRef } from 'react';
import { VegaIcon, VegaIconNames } from '../icon'; import { VegaIcon, VegaIconNames } from '../icon';
import { Icon } from '../icon'; import { Icon } from '../icon';
@ -164,10 +164,9 @@ export const DropdownMenuSeparator = forwardRef<
/** /**
* Container element for submenus * Container element for submenus
*/ */
export const DropdownMenuSub = forwardRef< export const DropdownMenuSub = (
React.ElementRef<typeof DropdownMenuPrimitive.Sub>, subProps: ComponentProps<typeof DropdownMenuPrimitive.Sub>
React.ComponentProps<typeof DropdownMenuPrimitive.Sub> ) => <DropdownMenuPrimitive.Sub {...subProps} />;
>(({ ...subProps }) => <DropdownMenuPrimitive.Sub {...subProps} />);
/** /**
* Container within a DropdownMenuSub specifically for the content * Container within a DropdownMenuSub specifically for the content
@ -201,10 +200,9 @@ export const DropdownMenuSubTrigger = forwardRef<
* Portal to ensure menu portions are rendered outwith where they appear in the * Portal to ensure menu portions are rendered outwith where they appear in the
* DOM. * DOM.
*/ */
export const DropdownMenuPortal = forwardRef< export const DropdownMenuPortal = (
React.ElementRef<typeof DropdownMenuPrimitive.Portal>, portalProps: ComponentProps<typeof DropdownMenuPrimitive.Portal>
React.ComponentProps<typeof DropdownMenuPrimitive.Portal> ) => <DropdownMenuPrimitive.Portal {...portalProps} />;
>(({ ...portalProps }) => <DropdownMenuPrimitive.Portal {...portalProps} />);
/** /**
* Wraps a regular DropdownMenuItem with copy to clip board functionality * Wraps a regular DropdownMenuItem with copy to clip board functionality