1
0
mirror of https://github.com/vercel/commerce.git synced 2025-03-31 17:25:53 +00:00

forwardRef

This commit is contained in:
Belen Curcio 2020-12-02 13:24:25 -03:00
parent 95897aa1c5
commit 3770ad7ea8

@ -7,7 +7,8 @@ interface ClickOutsideProps {
children: any children: any
} }
const ClickOutside = ( const ClickOutside = forwardRef(
(
{ active = true, onClick, children }: ClickOutsideProps, { active = true, onClick, children }: ClickOutsideProps,
ref: Ref<HTMLDivElement> | null | any = {} ref: Ref<HTMLDivElement> | null | any = {}
) => { ) => {
@ -39,5 +40,6 @@ const ClickOutside = (
return React.cloneElement(children, { ref }) return React.cloneElement(children, { ref })
} }
)
export default forwardRef(ClickOutside) export default ClickOutside