Skip to content

Commit 740533a

Browse files
committed
Close doesn't need a forwardRef
1 parent 52a9f77 commit 740533a

File tree

2 files changed

+3
-8
lines changed

2 files changed

+3
-8
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@accessible/popover",
3-
"version": "2.0.1",
3+
"version": "2.0.2",
44
"homepage": "https://github.com/accessible-ui/popover#readme",
55
"repository": "github:accessible-ui/popover",
66
"bugs": "https://github.com/accessible-ui/popover/issues",

src/index.tsx

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -690,12 +690,8 @@ export interface CloseProps {
690690
children: JSX.Element | React.ReactElement
691691
}
692692

693-
export const Close: React.FC<CloseProps> = React.forwardRef<
694-
JSX.Element | React.ReactElement,
695-
CloseProps
696-
>(({children}, ref) => {
693+
export const Close: React.FC<CloseProps> = ({children}, ref) => {
697694
const {close, isOpen, id} = usePopover()
698-
ref = useMergedRef(children.props.ref, ref)
699695
const onClick = useCallback(
700696
e => {
701697
close()
@@ -710,9 +706,8 @@ export const Close: React.FC<CloseProps> = React.forwardRef<
710706
'aria-expanded': String(isOpen),
711707
'aria-label': children.props['aria-label'] || 'Close',
712708
onClick,
713-
ref,
714709
})
715-
})
710+
}
716711

717712
export interface TriggerProps {
718713
on: string

0 commit comments

Comments
 (0)