@swan-io/lake 2.3.0 → 2.3.1

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@swan-io/lake",
3
- "version": "2.3.0",
3
+ "version": "2.3.1",
4
4
  "engines": {
5
5
  "node": ">=18.0.0",
6
6
  "yarn": "^1.22.0"
@@ -5,7 +5,7 @@ type Props = {
5
5
  error: Error;
6
6
  resetError: () => void;
7
7
  }) => ReactElement;
8
- onError?: (error: Error, componentStack: ErrorInfo["componentStack"]) => void;
8
+ onError?: (error: Error, errorInfo: ErrorInfo) => void;
9
9
  };
10
10
  type State = {
11
11
  error: Error | null;
@@ -13,7 +13,7 @@ type State = {
13
13
  export declare class ErrorBoundary extends Component<Props, State> {
14
14
  state: State;
15
15
  static getDerivedStateFromError(error: Error): State;
16
- componentDidCatch(error: Error, { componentStack }: ErrorInfo): void;
16
+ componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
17
17
  resetError: () => void;
18
18
  render(): ReactNode;
19
19
  }
@@ -37,16 +37,16 @@ export class ErrorBoundary extends Component {
37
37
  static getDerivedStateFromError(error) {
38
38
  return { error };
39
39
  }
40
- componentDidCatch(error, { componentStack }) {
40
+ componentDidCatch(error, errorInfo) {
41
41
  const { onError } = this.props;
42
42
  if (isError(error)) {
43
43
  const cause = new Error(error.message);
44
44
  cause.name = `ErrorBoundary ${cause.name}`;
45
- cause.stack = componentStack;
45
+ cause.stack = errorInfo.componentStack;
46
46
  setCause(error, cause);
47
47
  }
48
48
  if (onError != null) {
49
- onError(error, componentStack);
49
+ onError(error, errorInfo);
50
50
  }
51
51
  }
52
52
  resetError = () => {