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
The component renders a textarea element with a ref that receives callback returned from _useResizeObserver__ hook. There are also two button to disconnect and reconnect observer by functions returned from hook.
6
+
7
+
Hook is initialized with a callback that verifies if textarea element has a width minor or major of 100 px amd set result into __state variable__. The __state variable__ value is displayed on screen.
* **`useResizeObserver`**: Hook to use ResizeObserver. Refer to [ResizeObserver API](https://developer.mozilla.org/en-US/docs/Web/API/Resize_Observer_API)
5
+
* @param {ResizeObserverCallback} cb - The function called whenever an observed resize occurs. The function is called with two parameters: __entries__ and __observer__.
6
+
* @param {ResizeObserverOptions} [opts] - An options object allowing you to set options for the observation.
7
+
* @returns {[RefCallback<T>, ()=>void, ()=>void]} result - array with: cb for ref component attribute to observe, function to _disconnect_ observer, function to _reconnect_ observer.
0 commit comments