mirror of
https://github.com/Nezumi-2711/react-training.git
synced 2026-09-23 04:19:48 +00:00
Add modal component and replace room dialog form
This commit is contained in:
@@ -9,11 +9,11 @@ import { Nullable } from '../types/common';
|
||||
* @param listeningCapturing A boolean value indicating that events of this type will be dispatched to the registered listener before being dispatched to any EventTarget beneath it in the DOM tree. If not specified, defaults to false.
|
||||
* @returns Return a mutable ref object
|
||||
*/
|
||||
export const useOutsideClick = (
|
||||
export const useOutsideClick = <T extends Node>(
|
||||
handler: () => void,
|
||||
listeningCapturing = true
|
||||
): MutableRefObject<Nullable<HTMLUListElement>> => {
|
||||
const ref = useRef<HTMLUListElement>(null);
|
||||
): MutableRefObject<Nullable<T>> => {
|
||||
const ref = useRef<T>(null);
|
||||
|
||||
useEffect(() => {
|
||||
const handleClick = (e: Event) => {
|
||||
|
||||
Reference in New Issue
Block a user