fix(dropdown): spread key warning (#1377)

This commit is contained in:
Junior Garcia 2023-08-12 11:33:13 -03:00 committed by GitHub
parent e9c08abd55
commit fd4e01dcfa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 4 deletions

View File

@ -0,0 +1,5 @@
---
"@nextui-org/dropdown": patch
---
fix #1376 Dropdown item spread key warning

View File

@ -49,7 +49,6 @@ const DropdownSection = forwardRef<"li", DropdownSectionProps>(
as, as,
variant, variant,
color, color,
key: keyProp,
disableAnimation, disableAnimation,
onAction, onAction,
closeOnSelect, closeOnSelect,
@ -80,7 +79,6 @@ const DropdownSection = forwardRef<"li", DropdownSectionProps>(
return ( return (
<Component <Component
key={keyProp || item.key}
data-slot="base" data-slot="base"
{...mergeProps(itemProps, otherProps)} {...mergeProps(itemProps, otherProps)}
className={slots.base({class: baseStyles})} className={slots.base({class: baseStyles})}

View File

@ -37,7 +37,6 @@ export function useDropdownItem<T extends object>(originalProps: UseDropdownItem
item, item,
state, state,
shortcut, shortcut,
key: keyProp,
description, description,
startContent, startContent,
endContent, endContent,
@ -122,7 +121,6 @@ export function useDropdownItem<T extends object>(originalProps: UseDropdownItem
} }
const getItemProps: PropGetter = (props = {}) => ({ const getItemProps: PropGetter = (props = {}) => ({
key: keyProp || key,
ref: domRef, ref: domRef,
...mergeProps( ...mergeProps(
itemProps, itemProps,