forwardRef

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

View File

@ -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