Skip to content

React 19 warning: ClickOutside captured a close event but does not have a ref to compare it to. useClickOutside(), should be passed a ref that resolves to a DOM node #870

Closed
@printfn

Description

@printfn

Version

v6.4.0

Steps to reproduce

I'm getting a warning 'ClickOutside captured a close event but does not have a ref to compare it to. useClickOutside(), should be passed a ref that resolves to a DOM node' since updating to React 19.

The stack trace points at this code:

warn(
!!currentTarget,
'ClickOutside captured a close event but does not have a ref to compare it to. ' +
'useClickOutside(), should be passed a ref that resolves to a DOM node'
);

I'll see if I can make a minimal reproduction later.

Expected Behavior

It shouldn't produce warnings.

Actual Behavior

It's producing warnings as of React 19.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions