Fix button prop warnings

This commit is contained in:
Robert Long 2022-01-18 14:25:02 -08:00
commit 6311a869f9

View file

@ -34,12 +34,17 @@ export const Button = forwardRef(
iconStyle, iconStyle,
className, className,
children, children,
onPress,
onPressStart,
...rest ...rest
}, },
ref ref
) => { ) => {
const buttonRef = useObjectRef(ref); const buttonRef = useObjectRef(ref);
const { buttonProps } = useButton(rest, buttonRef); const { buttonProps } = useButton(
{ onPress, onPressStart, ...rest },
buttonRef
);
// TODO: react-aria's useButton hook prevents form submission via keyboard // TODO: react-aria's useButton hook prevents form submission via keyboard
// Remove the hack below after this is merged https://github.com/adobe/react-spectrum/pull/904 // Remove the hack below after this is merged https://github.com/adobe/react-spectrum/pull/904