mirror of
https://github.com/vercel/commerce.git
synced 2025-03-28 16:25:53 +00:00
forwardRef
This commit is contained in:
parent
95897aa1c5
commit
3770ad7ea8
@ -7,7 +7,8 @@ interface ClickOutsideProps {
|
||||
children: any
|
||||
}
|
||||
|
||||
const ClickOutside = (
|
||||
const ClickOutside = forwardRef(
|
||||
(
|
||||
{ active = true, onClick, children }: ClickOutsideProps,
|
||||
ref: Ref<HTMLDivElement> | null | any = {}
|
||||
) => {
|
||||
@ -39,5 +40,6 @@ const ClickOutside = (
|
||||
|
||||
return React.cloneElement(children, { ref })
|
||||
}
|
||||
)
|
||||
|
||||
export default forwardRef(ClickOutside)
|
||||
export default ClickOutside
|
||||
|
Loading…
x
Reference in New Issue
Block a user