Skip to content

Demo for useClickOutside hook does not count outside clicks #441

@forckes

Description

@forckes

The current Demo component for the useClickOutside hook does not increment the counter when clicking outside the target element.

The issue appears to be caused by not properly destructuring the ref returned by useClickOutside:

const clickOutsideRef = useClickOutside<HTMLDivElement>(() => { ... });

According to the documentation ref should be destructured like this:

const { ref } = useClickOutside<HTMLDivElement>(() => { ... });

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions