Fix button prop warnings
This commit is contained in:
parent
98355edf92
commit
6311a869f9
1 changed files with 6 additions and 1 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue