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
description="A callback function that is executed when the element is set. This function can return a cleanup function."
21
21
/>
22
22
@@ -31,7 +31,7 @@ function useRefEffect(
31
31
32
32
<Interface
33
33
name=""
34
-
type="(element: Element | null) => void"
34
+
type="(element: RefElement | null) => void"
35
35
description="function to set the element. Pass this function to the <code>ref</code> attribute, and the <code>callback</code> will be called whenever the element changes."
* `useRefEffect` is a React hook that helps you set a reference to a specific DOM element and execute a callback whenever the element changes.
10
10
* This hook calls a cleanup function whenever the element changes to prevent memory leaks.
11
11
*
12
-
* @param {(element: Element) => CleanupCallback | void} callback - A callback function that is executed when the element is set. This function can return a cleanup function.
12
+
* @param {(element: RefElement) => CleanupCallback | void} callback - A callback function that is executed when the element is set. This function can return a cleanup function.
13
13
* @param {DependencyList} deps - An array of dependencies that define when the callback should be re-executed. The `callback` is re-executed whenever the `deps` change.
14
14
*
15
-
* @returns {(element: Element | null) => void} A function to set the element. Pass this function to the `ref` attribute, and the `callback` will be called whenever the element changes.
15
+
* @returns {(element: RefElement | null) => void} A function to set the element. Pass this function to the `ref` attribute, and the `callback` will be called whenever the element changes.
0 commit comments