@cupra/ui-react 1.0.0-canary.19 → 1.0.0-canary.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,24 +1,24 @@
1
- import { useRef as u, useEffect as l } from "react";
1
+ import { useRef as f, useEffect as l } from "react";
2
2
  function d(e) {
3
- const o = u(null), n = u(e);
3
+ const n = f(null), t = f(e);
4
4
  return l(() => {
5
- n.current = e;
5
+ t.current = e;
6
6
  }, [e]), l(() => {
7
- const t = o.current;
8
- if (!t) return;
9
- const c = {};
10
- return Object.keys(n.current).forEach((r) => {
7
+ const c = n.current;
8
+ if (!c) return;
9
+ const o = {};
10
+ return Object.keys(t.current).forEach((r) => {
11
11
  const s = (i) => {
12
- const f = n.current[r];
13
- f && f(i);
12
+ const u = t.current[r];
13
+ u && u(i);
14
14
  };
15
- c[r] = s, t.addEventListener(r, s);
15
+ o[r] = s, c.addEventListener(r, s);
16
16
  }), () => {
17
- Object.keys(c).forEach((r) => {
18
- t.removeEventListener(r, c[r]);
17
+ Object.keys(o).forEach((r) => {
18
+ c.removeEventListener(r, o[r]);
19
19
  });
20
20
  };
21
- }, []), { ref: o };
21
+ }, [n.current]), { ref: n };
22
22
  }
23
23
  export {
24
24
  d as useHandleEvent
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cupra/ui-react",
3
- "version": "1.0.0-canary.19",
3
+ "version": "1.0.0-canary.20",
4
4
  "description": "React components library",
5
5
  "author": "SEAT S.A.",
6
6
  "license": "SEAT S.A. Library EULA 1.0",