---
title: "Discussion on \"How to create a reusable useOnClickOutside hook in react?\" | Hashnode"
description: "Discussion on \"How to create a reusable useOnClickOutside hook in react?\". A custom hook to detect the mouse or touch event on the outside of specified elements"
url: "https://hashnode.com/posts/how-to-create-a-reusable-useonclickoutside-hook-in-react/629e2d1f4d2584547c17d635"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [How to create a reusable useOnClickOutside hook in react?](https://animeshgarai.hashnode.dev/how-to-create-a-reusable-useonclickoutside-hook-in-react?utm_source=hashnode&utm_medium=feed)

A custom hook to detect the mouse or touch event on the outside of specified elements

Jun 6, 2022 · 3 min read · animeshgarai.hashnode.dev  
Read the article

-   [#reactjs](https://hashnode.com/tag/reactjs)
-   [#hooks](https://hashnode.com/tag/hooks)
-   [#reacthooks](https://hashnode.com/tag/reacthooks)

## Written by

[Animesh Garai](https://hashnode.com/@animeshgarai09)

@animeshgarai09 · Kolkata, India

  
[View profile](https://hashnode.com/@animeshgarai09)

JavaScript Enthusiast • ReactJS Developer • UI UX Designer

## Responses

Markdown supported · ⌘↵ to post

No responses yet.
