@tramvai/react 6.79.24 → 6.80.6

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.
@@ -27,9 +27,11 @@ class UniversalErrorBoundary extends Component {
27
27
  componentDidCatch(error, errorInfo) {
28
28
  const { errorHandlers } = this.props;
29
29
  if (errorHandlers) {
30
- errorHandlers.forEach((handler) => {
31
- handler(error, errorInfo);
32
- });
30
+ if (errorHandlers) {
31
+ errorHandlers.forEach((handler) => {
32
+ handler(error, errorInfo);
33
+ });
34
+ }
33
35
  }
34
36
  }
35
37
  render() {
@@ -31,9 +31,11 @@ class UniversalErrorBoundary extends react.Component {
31
31
  componentDidCatch(error, errorInfo) {
32
32
  const { errorHandlers } = this.props;
33
33
  if (errorHandlers) {
34
- errorHandlers.forEach((handler) => {
35
- handler(error, errorInfo);
36
- });
34
+ if (errorHandlers) {
35
+ errorHandlers.forEach((handler) => {
36
+ handler(error, errorInfo);
37
+ });
38
+ }
37
39
  }
38
40
  }
39
41
  render() {
@@ -1,6 +1,10 @@
1
1
  import type React from 'react';
2
2
  import type { UniversalErrorBoundaryFallbackProps } from './UniversalErrorBoundary';
3
+ export type ErrorSeverity = 'critical' | 'error';
3
4
  type ErrorBoundaryHandler = (error: Error, errorInfo: React.ErrorInfo) => void;
5
+ /**
6
+ * @deprecated subsribe to `TRAMVAI_HOOKS_TOKEN['react:error']` hook instead, looking for the `page-error-boundary` event
7
+ */
4
8
  export declare const ERROR_BOUNDARY_TOKEN: ErrorBoundaryHandler & {
5
9
  __type?: "multi token" | undefined;
6
10
  };
@@ -1,5 +1,8 @@
1
1
  import { createToken } from '@tinkoff/dippy';
2
2
 
3
+ /**
4
+ * @deprecated subsribe to `TRAMVAI_HOOKS_TOKEN['react:error']` hook instead, looking for the `page-error-boundary` event
5
+ */
3
6
  const ERROR_BOUNDARY_TOKEN = createToken('reactErrorBoundaryHandlers', {
4
7
  multi: true,
5
8
  });
@@ -4,6 +4,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var dippy = require('@tinkoff/dippy');
6
6
 
7
+ /**
8
+ * @deprecated subsribe to `TRAMVAI_HOOKS_TOKEN['react:error']` hook instead, looking for the `page-error-boundary` event
9
+ */
7
10
  const ERROR_BOUNDARY_TOKEN = dippy.createToken('reactErrorBoundaryHandlers', {
8
11
  multi: true,
9
12
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tramvai/react",
3
- "version": "6.79.24",
3
+ "version": "6.80.6",
4
4
  "description": "",
5
5
  "main": "lib/react.js",
6
6
  "typings": "lib/react.d.ts",
@@ -18,13 +18,13 @@
18
18
  },
19
19
  "dependencies": {
20
20
  "@loadable/component": "^5.15.2",
21
- "@tramvai/types-actions-state-context": "6.79.24",
21
+ "@tramvai/types-actions-state-context": "6.80.6",
22
22
  "@types/loadable__component": "^5.13.4",
23
23
  "hoist-non-react-statics": "^3.3.0"
24
24
  },
25
25
  "peerDependencies": {
26
- "@tinkoff/dippy": "0.12.8",
27
- "@tinkoff/url": "0.12.3",
26
+ "@tinkoff/dippy": "^1.0.0",
27
+ "@tinkoff/url": "0.12.4",
28
28
  "@tinkoff/utils": "^2.1.2",
29
29
  "react": ">=16.14.0",
30
30
  "react-dom": ">=16.14.0",