Skip to content

Commit f3747c9

Browse files
committed
docs(hooks): updated hooks docs
1 parent 210c7f8 commit f3747c9

3 files changed

Lines changed: 17 additions & 14 deletions

File tree

src/hooks/useIntersection/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ The `useIntersection` hook works with the [Intersection Observer API](https://de
1414

1515
| Name | Description | Type | Default |
1616
| :---------- | :-------------------------------------------- | :------------------------: | :-----: |
17-
| element | The observed element | `React.RefObject` | |
17+
| element | The observed element | `Element \| null` | |
1818
| options | Intersection observer options | `IntersectionObserverInit` | |
1919
| onIntersect | Callback when observed element is intersected | `() => void` | |

src/hooks/useOutsideClick/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The `useOutsideClick` hook helps to track the click outside of the tracked eleme
1212

1313
## Properties
1414

15-
| Name | Description | Type | Default |
16-
| :------ | :---------------------------------------------------------------- | :---------------: | :-----: |
17-
| ref | Ref-link to target of observation | `React.RefObject` | |
18-
| handler | Callback when a click is triggered outside the observation target | `() => void` | |
15+
| Name | Description | Type | Default |
16+
| :------ | :---------------------------------------------------------------- | :-------------------------------------: | :-----: |
17+
| ref | Ref-link to target of observation | `React.RefObject` | |
18+
| handler | Callback when a click is triggered outside the observation target | `(e: MouseEvent \| TouchEvent) => void` | |

src/hooks/useSelect/README.md

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,22 @@ The `useSelect` hook used to handle items selection in list
1717
| value | Values that represent selected items | `string[]` | |
1818
| defaultValue | Default values used in case of uncontrolled usage | `string[]` | `[]` |
1919
| multiple | Indicates that multiple items can be selected in the list | `boolean` | `false` |
20+
| disabled | Disables selection changes | `boolean` | |
2021
| onUpdate | Invokes inside of `handleSelection` function | `function` | |
2122
| defaultOpen | Initial value for `open` property | `boolean` | `false` |
2223
| open | Controlled `open` property | `boolean` | |
2324
| onOpenChange | Invokes while `open` property changes | `function` | |
25+
| onClose | Invokes when the list closes | `function` | |
2426

2527
## Result
2628

27-
| Name | Description | Type |
28-
| :-------------- | :---------------------------------------------------------- | :--------: |
29-
| value | Values that represent selected items | `string[]` |
30-
| handleSelection | Handles item selection | `function` |
31-
| open | List container visibility state | `boolean` |
32-
| setOpen | (deprecated) use toggleOpen. Sets value for `open` property | `function` |
33-
| toggleOpen | Invert the value of `open` | `function` |
34-
| activeIndex | Index of active option | `number` |
35-
| setActiveIndex | Sets value for `activeIndex` property | `function` |
29+
| Name | Description | Type |
30+
| :--------------- | :------------------------------------ | :--------: |
31+
| value | Values that represent selected items | `string[]` |
32+
| setValue | Sets value directly | `function` |
33+
| open | List container visibility state | `boolean` |
34+
| toggleOpen | Invert the value of `open` | `function` |
35+
| activeIndex | Index of active option | `number` |
36+
| setActiveIndex | Sets value for `activeIndex` property | `function` |
37+
| handleSelection | Handles item selection | `function` |
38+
| handleClearValue | Clears selected value | `function` |

0 commit comments

Comments
 (0)