You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hook to automatically request focus for an DOM element.
60
+
61
+
#### Parameters
62
+
63
+
-`isFocused`**[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** if true, the focus will be requested (optional, default `true`)
64
+
-`options`**FocusOptions** options of the focus request
65
+
66
+
Returns **any** the ref which holds the element
50
67
51
68
### useClassName
52
69
@@ -110,17 +127,26 @@ Hook to memoize a debounced version of a callback.
110
127
111
128
Returns **function (): any** a memoized and debounced callback
112
129
113
-
### useExclusiveBooleanProps
130
+
### useDebouncedValue
114
131
115
-
Hook for asserting mutually exclusive boolean props. Useful for components that use boolean props
116
-
to choose styling variants.
132
+
Hook to keep a debounced reference of a value.
117
133
118
134
#### Parameters
119
135
120
-
-`props`**[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** the mutually exclusive boolean props
136
+
-`value`**any** the value to be debounced
137
+
-`delay`**[number](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Number)** the number of milliseconds to delay
138
+
139
+
Returns **any** a debounced value
140
+
141
+
### useLazyRef
121
142
143
+
Hook equivalent to useRef, but with a lazy initialization for computed value.
144
+
145
+
#### Parameters
122
146
123
-
- Throws **any** if two or more booleans props are set as true
147
+
-`initializer`**function (): T** the function the computes the ref value
148
+
149
+
Returns **any** the ref
124
150
125
151
### useMediaQuery
126
152
@@ -153,6 +179,19 @@ Hook to create a stable callback from a mutable one.
153
179
154
180
Returns **any** a stable callback
155
181
182
+
### useSafely
183
+
184
+
Hook that wraps pairs of state and updater to provide a new updater which
185
+
can be safe and asynchronically called even after the component unmounted.
186
+
187
+
#### Parameters
188
+
189
+
-`pair`**\[any, function (): any]** the state and updater pair which will be patched
190
+
-`pair.0` the state value
191
+
-`pair.1` the state updater function
192
+
193
+
Returns **any** a state value and safe updater pair
0 commit comments