message: optimize: useClickAway
diff: @@ -7,7 +7,6 @@ group:
  title: Dom
  path: /dom
  order: 13
  -legacy: /dom/use-click-away
  ---
  # useClickAway
  @@ -20,17 +19,27 @@ A hook that elegantly manages click outside of target elements.
  <code src="./demo/demo1.tsx" />
  +### Custom DOM
  +
  <code src="./demo/demo2.tsx" />
  +### Support multiple DOM
  +
  <code src="./demo/demo3.tsx" />
  +### Listen to other events
  +
  +<code src="./demo/demo4.tsx" />
  +
  ## API
  ```ts
  +type Target = HTMLElement | React.MutableRefObject | () => HTMLElement;
  +
  useClickAway(
  onClickAway: (event: MouseEvent | TouchEvent) => void,
  - target: (() => HTMLElement) | HTMLElement | React.MutableRefObject |
  - ((() => HTMLElement) | HTMLElement | React.MutableRefObject)[],
  + target: Target | Target[],
  + eventName?: string
  );
  ```
  @@ -38,5 +47,6 @@ useClickAway(
  | Property | Description | Type | Default |
  |---------|----------------------------------------------|------------------------|--------|
  -| onClickAway | Trigger Function | (event) => void | - |
  -| target | DOM elements or Ref Objects | (() => HTMLElement) \| HTMLElement \| React.MutableRefObject \| ((() => HTMLElement) \| HTMLElement \| React.MutableRefObject)[] | - |
  +| onClickAway | Trigger Function | `(event) => void` | - |
  +| target | DOM elements or Ref, support array | `Target` \| `Target[]` | - |
  +| eventName | Set the event to be listened | `string` | `click` |
  \ No newline at end of file
  