@trackunit/react-core-hooks 0.2.256 → 0.2.257

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.
package/index.cjs.js CHANGED
@@ -48,10 +48,12 @@ const useAnalytics = (events) => {
48
48
  throw new Error("useAnalytics must be used within an AnalyticsProvider");
49
49
  }
50
50
  const logEvent = React.useMemo(() => logEventWithDescription(context.logEvent, events), [context.logEvent, events]);
51
- return {
52
- ...context,
53
- logEvent,
54
- };
51
+ return React.useMemo(() => {
52
+ return {
53
+ ...context,
54
+ logEvent,
55
+ };
56
+ }, [context, logEvent]);
55
57
  };
56
58
  // Automatically append the description from the event type
57
59
  const logEventWithDescription = (logEvent, events) => {
package/index.esm.js CHANGED
@@ -28,10 +28,12 @@ const useAnalytics = (events) => {
28
28
  throw new Error("useAnalytics must be used within an AnalyticsProvider");
29
29
  }
30
30
  const logEvent = useMemo(() => logEventWithDescription(context.logEvent, events), [context.logEvent, events]);
31
- return {
32
- ...context,
33
- logEvent,
34
- };
31
+ return useMemo(() => {
32
+ return {
33
+ ...context,
34
+ logEvent,
35
+ };
36
+ }, [context, logEvent]);
35
37
  };
36
38
  // Automatically append the description from the event type
37
39
  const logEventWithDescription = (logEvent, events) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trackunit/react-core-hooks",
3
- "version": "0.2.256",
3
+ "version": "0.2.257",
4
4
  "repository": "https://github.com/Trackunit/manager",
5
5
  "license": "SEE LICENSE IN LICENSE.txt",
6
6
  "engines": {