@bigbinary/neeto-commons-frontend 2.0.124 → 2.0.125

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/react-utils.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import React, { ComponentType, ElementType, ReactNode } from "react";
2
2
  import { RouteProps } from "react-router-dom";
3
3
  import { Notice } from "@honeybadger-io/js/dist/server/types/core/types";
4
4
  import { History } from "history";
@@ -47,8 +47,9 @@ import { UseQueryOptions, UseQueryResult, UseMutationOptions, UseMutationResult
47
47
  *
48
48
  */
49
49
  export const HoneybadgerErrorBoundary: React.FC<{
50
- ErrorComponent?: React.ReactNode | React.ComponentType<any>;
50
+ ErrorComponent?: ReactNode | ComponentType | ElementType;
51
51
  filterErrors?: (error: Notice) => boolean;
52
+ children?: ReactNode;
52
53
  }>;
53
54
  /**
54
55
  *
package/react-utils.js CHANGED
@@ -92,6 +92,8 @@ var FallbackComponent = function FallbackComponent() {
92
92
  }))));
93
93
  };
94
94
  var ignorableErrorsRegex = /(window\.requestAnimationFrame|ResizeObserver|ChunkLoadError|window\.webkit\.messageHandlers)/;
95
+
96
+ /** @type {import("neetocommons/react-utils").HoneybadgerErrorBoundary} */
95
97
  var HoneybadgerErrorBoundary = function HoneybadgerErrorBoundary(_ref) {
96
98
  var children = _ref.children,
97
99
  _ref$ErrorComponent = _ref.ErrorComponent,
@@ -99,7 +101,7 @@ var HoneybadgerErrorBoundary = function HoneybadgerErrorBoundary(_ref) {
99
101
  _ref$filterErrors = _ref.filterErrors,
100
102
  filterErrors = _ref$filterErrors === void 0 ? undefined : _ref$filterErrors;
101
103
  Honeybadger.beforeNotify(function (notice) {
102
- if (ignorableErrorsRegex.test(notice.message) || notice.stack.includes("chrome-extension://")) {
104
+ if (notice && (ignorableErrorsRegex.test(notice.message) || notice.stack.includes("chrome-extension://"))) {
103
105
  return false;
104
106
  }
105
107
  return filterErrors === null || filterErrors === void 0 ? void 0 : filterErrors(notice);
@@ -114,14 +116,10 @@ var HoneybadgerErrorBoundary = function HoneybadgerErrorBoundary(_ref) {
114
116
  breadcrumbsEnabled: true,
115
117
  projectRoot: "webpack:///./"
116
118
  });
117
- return (
118
- /*#__PURE__*/
119
- // @ts-ignore
120
- React__default.createElement(HoneybadgerErrorBoundary$1, {
121
- ErrorComponent: ErrorComponent,
122
- honeybadger: honeybadger
123
- }, children)
124
- );
119
+ return /*#__PURE__*/React__default.createElement(HoneybadgerErrorBoundary$1, {
120
+ ErrorComponent: ErrorComponent,
121
+ honeybadger: honeybadger
122
+ }, children);
125
123
  };
126
124
 
127
125
  function _objectWithoutPropertiesLoose(source, excluded) {