Skip to content

Commit 0b541f4

Browse files
authored
Fix useCheckbox example (#5185)
1 parent 2fa39c9 commit 0b541f4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

packages/@react-aria/checkbox/docs/useCheckbox.mdx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,7 @@ with a keyboard, not with a mouse or touch.
115115
```tsx example export=true
116116
import {VisuallyHidden} from '@react-aria/visually-hidden';
117117
import {useFocusRing} from '@react-aria/focus';
118+
import {mergeProps} from '@react-aria/utils';
118119

119120
function Checkbox(props) {
120121
let state = useToggleState(props);
@@ -126,7 +127,7 @@ function Checkbox(props) {
126127
return (
127128
<label style={{display: 'flex', alignItems: 'center', opacity: props.isDisabled ? 0.4 : 1}}>
128129
<VisuallyHidden>
129-
<input {...inputProps} {...focusProps} ref={ref} />
130+
<input {...mergeProps(inputProps, focusProps)} ref={ref} />
130131
</VisuallyHidden>
131132
<svg
132133
width={24}

0 commit comments

Comments
 (0)