@honeybadger-io/react 6.1.25 → 6.1.27

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/README.md CHANGED
@@ -40,23 +40,21 @@ your own build environment may be just different enough to require some
40
40
  adjustments. If you find that our artifacts don't quite meet your needs,
41
41
  please [file an issue on GitHub](https://github.com/honeybadger-io/honeybadger-react/issues).
42
42
 
43
- ## Example app
43
+ ## Example apps
44
44
 
45
- There's a minimal implementation of a honeybadger-react integration in the ./example
46
- folder. If you want to contribute a patch to honeybadger-react, it can be useful to have
47
- the demo app running.
45
+ There are minimal implementations of a honeybadger-react integration in the ./examples
46
+ folder. If you want to contribute a patch to @honeybadger-io/react, it can be useful to have
47
+ the demo apps running.
48
48
 
49
- To run it, issue these commands from your shell:
49
+ To run the example app using React v19, issue these commands from your shell:
50
50
 
51
51
  ```bash
52
- cd example
52
+ cd examples/react-19
53
53
  npm install
54
54
  REACT_APP_HONEYBADGER_API_KEY=b425b636 npm run start
55
55
  ```
56
56
 
57
- This will serve the demo app with hot reload at localhost:3000
58
-
59
- For a detailed explanation on how hot reloading works, check out the [documentation](https://webpack.js.org/concepts/hot-module-replacement/).
57
+ This will start the demo app with hot reload enabled.
60
58
 
61
59
  ## Development
62
60
 
@@ -1,13 +1,4 @@
1
- import React, { Component } from 'react';
2
- import PropTypes from 'prop-types';
3
- export interface DefaultErrorComponentProps {
4
- error: Error | null;
5
- info: React.ErrorInfo | null;
6
- }
7
- export default class DefaultErrorComponent extends Component<DefaultErrorComponentProps, {}> {
8
- static propTypes: {
9
- error: PropTypes.Requireable<object>;
10
- info: PropTypes.Requireable<object>;
11
- };
12
- render(): JSX.Element;
13
- }
1
+ import React from 'react';
2
+ import { DefaultErrorComponentProps } from './types';
3
+ declare function DefaultErrorComponent({ error, info }: DefaultErrorComponentProps): React.JSX.Element;
4
+ export default DefaultErrorComponent;
@@ -1,30 +1,13 @@
1
- import React, { Component, ComponentType, ElementType, ReactNode } from 'react';
2
- import Honeybadger from '@honeybadger-io/js';
3
- import { DefaultErrorComponentProps } from './DefaultErrorComponent';
4
- import PropTypes from 'prop-types';
5
- interface HoneybadgerErrorBoundaryProps {
6
- honeybadger: typeof Honeybadger;
7
- showUserFeedbackFormOnError?: boolean;
8
- ErrorComponent?: ReactNode | ComponentType | ElementType;
9
- children?: ReactNode;
10
- }
11
- interface HoneybadgerErrorBoundaryState extends DefaultErrorComponentProps {
12
- errorOccurred: boolean;
13
- }
1
+ import React, { Component } from 'react';
2
+ import { HoneybadgerErrorBoundaryProps, HoneybadgerErrorBoundaryState } from './types';
14
3
  export default class HoneybadgerErrorBoundary extends Component<HoneybadgerErrorBoundaryProps, HoneybadgerErrorBoundaryState> {
15
- static propTypes: {
16
- honeybadger: PropTypes.Validator<object>;
17
- showUserFeedbackFormOnError: PropTypes.Requireable<boolean>;
18
- children: PropTypes.Requireable<PropTypes.ReactElementLike>;
19
- ErrorComponent: PropTypes.Requireable<NonNullable<PropTypes.ReactElementLike | ((...args: any[]) => any) | null | undefined>>;
20
- };
21
4
  static defaultProps: {
22
5
  showUserFeedbackFormOnError: boolean;
23
6
  };
24
7
  constructor(props: HoneybadgerErrorBoundaryProps);
25
8
  static getDerivedStateFromError(error: Error): HoneybadgerErrorBoundaryState;
9
+ componentDidMount(): void;
26
10
  componentDidCatch(error: Error, errorInfo: React.ErrorInfo): void;
27
11
  private getErrorComponent;
28
- render(): JSX.Element;
12
+ render(): React.JSX.Element;
29
13
  }
30
- export {};
@@ -4,27 +4,18 @@ Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
5
  var Honeybadger = require('@honeybadger-io/js');
6
6
  var React = require('react');
7
- var PropTypes = require('prop-types');
8
7
 
9
8
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
10
9
 
11
10
  var Honeybadger__default = /*#__PURE__*/_interopDefaultLegacy(Honeybadger);
12
11
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
13
- var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
14
12
 
15
- // eslint-disable-next-line @typescript-eslint/ban-types
16
- class DefaultErrorComponent extends React.Component {
17
- render() {
18
- return (React__default["default"].createElement("div", { className: 'error' },
19
- React__default["default"].createElement("div", null, "An Error Occurred"),
20
- React__default["default"].createElement("div", null, JSON.stringify(this.props.error, null, 2)),
21
- React__default["default"].createElement("div", null, this.props.info ? JSON.stringify(this.props.info, null, 2) : '')));
22
- }
13
+ function DefaultErrorComponent({ error, info }) {
14
+ return (React__default["default"].createElement("div", { className: 'error' },
15
+ React__default["default"].createElement("div", null, "An Error Occurred"),
16
+ React__default["default"].createElement("div", null, error ? error.toString() : ''),
17
+ React__default["default"].createElement("div", null, info ? JSON.stringify(info, null, 2) : '')));
23
18
  }
24
- DefaultErrorComponent.propTypes = {
25
- error: PropTypes__default["default"].object,
26
- info: PropTypes__default["default"].object
27
- };
28
19
 
29
20
  class HoneybadgerErrorBoundary extends React.Component {
30
21
  constructor(props) {
@@ -34,22 +25,24 @@ class HoneybadgerErrorBoundary extends React.Component {
34
25
  info: null,
35
26
  errorOccurred: false
36
27
  };
28
+ }
29
+ static getDerivedStateFromError(error) {
30
+ return { error: error, errorOccurred: true, info: null };
31
+ }
32
+ componentDidMount() {
37
33
  this.props.honeybadger.afterNotify((error, _notice) => {
38
34
  if (!error && this.props.showUserFeedbackFormOnError) {
39
35
  this.props.honeybadger.showUserFeedbackForm();
40
36
  }
41
37
  });
42
38
  }
43
- static getDerivedStateFromError(error) {
44
- return { error: error, errorOccurred: true, info: null };
45
- }
46
39
  componentDidCatch(error, errorInfo) {
47
- this.setState({ errorOccurred: true, error: error, info: errorInfo });
40
+ this.setState({ error, info: errorInfo });
48
41
  this.props.honeybadger.notify(error, { context: errorInfo });
49
42
  }
50
43
  getErrorComponent() {
51
44
  return this.props.ErrorComponent
52
- ? React__default["default"].createElement(this.props.ErrorComponent, this.state)
45
+ ? React__default["default"].createElement(this.props.ErrorComponent, { ...this.state })
53
46
  : React__default["default"].createElement(DefaultErrorComponent, { ...this.state });
54
47
  }
55
48
  render() {
@@ -58,12 +51,6 @@ class HoneybadgerErrorBoundary extends React.Component {
58
51
  : this.props.children));
59
52
  }
60
53
  }
61
- HoneybadgerErrorBoundary.propTypes = {
62
- honeybadger: PropTypes__default["default"].object.isRequired,
63
- showUserFeedbackFormOnError: PropTypes__default["default"].bool,
64
- children: PropTypes__default["default"].element,
65
- ErrorComponent: PropTypes__default["default"].oneOfType([PropTypes__default["default"].element, PropTypes__default["default"].func])
66
- };
67
54
  HoneybadgerErrorBoundary.defaultProps = {
68
55
  showUserFeedbackFormOnError: false
69
56
  };
@@ -71,7 +58,7 @@ HoneybadgerErrorBoundary.defaultProps = {
71
58
  const NOTIFIER = {
72
59
  name: '@honeybadger-io/react',
73
60
  url: 'https://github.com/honeybadger-io/honeybadger-js/tree/master/packages/react',
74
- version: '6.1.25'
61
+ version: '6.1.27'
75
62
  };
76
63
  Honeybadger__default["default"].setNotifier(NOTIFIER);
77
64
 
@@ -1 +1 @@
1
- {"version":3,"file":"honeybadger-react.cjs.js","sources":["../../build/DefaultErrorComponent.js","../../build/HoneybadgerErrorBoundary.js","../../build/index.js"],"sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport default class DefaultErrorComponent extends Component {\n render() {\n return (React.createElement(\"div\", { className: 'error' },\n React.createElement(\"div\", null, \"An Error Occurred\"),\n React.createElement(\"div\", null, JSON.stringify(this.props.error, null, 2)),\n React.createElement(\"div\", null, this.props.info ? JSON.stringify(this.props.info, null, 2) : '')));\n }\n}\nDefaultErrorComponent.propTypes = {\n error: PropTypes.object,\n info: PropTypes.object\n};\n//# sourceMappingURL=DefaultErrorComponent.js.map","import React, { Component } from 'react';\nimport DefaultErrorComponent from './DefaultErrorComponent';\nimport PropTypes from 'prop-types';\nexport default class HoneybadgerErrorBoundary extends Component {\n constructor(props) {\n super(props);\n this.state = {\n error: null,\n info: null,\n errorOccurred: false\n };\n this.props.honeybadger.afterNotify((error, _notice) => {\n if (!error && this.props.showUserFeedbackFormOnError) {\n this.props.honeybadger.showUserFeedbackForm();\n }\n });\n }\n static getDerivedStateFromError(error) {\n return { error: error, errorOccurred: true, info: null };\n }\n componentDidCatch(error, errorInfo) {\n this.setState({ errorOccurred: true, error: error, info: errorInfo });\n this.props.honeybadger.notify(error, { context: errorInfo });\n }\n getErrorComponent() {\n return this.props.ErrorComponent\n ? React.createElement(this.props.ErrorComponent, this.state)\n : React.createElement(DefaultErrorComponent, { ...this.state });\n }\n render() {\n return (React.createElement(React.Fragment, null, this.state.errorOccurred\n ? this.getErrorComponent()\n : this.props.children));\n }\n}\nHoneybadgerErrorBoundary.propTypes = {\n honeybadger: PropTypes.object.isRequired,\n showUserFeedbackFormOnError: PropTypes.bool,\n children: PropTypes.element,\n ErrorComponent: PropTypes.oneOfType([PropTypes.element, PropTypes.func])\n};\nHoneybadgerErrorBoundary.defaultProps = {\n showUserFeedbackFormOnError: false\n};\n//# sourceMappingURL=HoneybadgerErrorBoundary.js.map","import Honeybadger from '@honeybadger-io/js';\nimport HoneybadgerErrorBoundary from './HoneybadgerErrorBoundary';\nconst NOTIFIER = {\n name: '@honeybadger-io/react',\n url: 'https://github.com/honeybadger-io/honeybadger-js/tree/master/packages/react',\n version: '__VERSION__'\n};\nHoneybadger.setNotifier(NOTIFIER);\nexport { Honeybadger, HoneybadgerErrorBoundary };\n//# sourceMappingURL=index.js.map"],"names":["Component","React","PropTypes","Honeybadger"],"mappings":";;;;;;;;;;;;;;AAEA;AACe,MAAM,qBAAqB,SAASA,eAAS,CAAC;AAC7D,IAAI,MAAM,GAAG;AACb,QAAQ,QAAQC,yBAAK,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE;AACjE,YAAYA,yBAAK,CAAC,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE,mBAAmB,CAAC;AACjE,YA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;ACzCD,MAAM,QAAQ,GAAG;AACjB,IAAI,IAAI,EAAE,uBAAuB;AACjC,IAAI,GAAG,EAAE,6EAA6E;AACtF,IAAI,OAAO,EAAE,QAAa;AAC1B,CAAC,CAAC;AACFC,+BAAW,CAAC,WAAW,CAAC,QAAQ,CAAC;;;;;;;;"}
1
+ {"version":3,"file":"honeybadger-react.cjs.js","sources":["../../build/DefaultErrorComponent.js","../../build/HoneybadgerErrorBoundary.js","../../build/index.js"],"sourcesContent":["import React from 'react';\nfunction DefaultErrorComponent({ error, info }) {\n return (React.createElement(\"div\", { className: 'error' },\n React.createElement(\"div\", null, \"An Error Occurred\"),\n React.createElement(\"div\", null, error ? error.toString() : ''),\n React.createElement(\"div\", null, info ? JSON.stringify(info, null, 2) : '')));\n}\nexport default DefaultErrorComponent;\n//# sourceMappingURL=DefaultErrorComponent.js.map","import React, { Component } from 'react';\nimport DefaultErrorComponent from './DefaultErrorComponent';\nexport default class HoneybadgerErrorBoundary extends Component {\n constructor(props) {\n super(props);\n this.state = {\n error: null,\n info: null,\n errorOccurred: false\n };\n }\n static getDerivedStateFromError(error) {\n return { error: error, errorOccurred: true, info: null };\n }\n componentDidMount() {\n this.props.honeybadger.afterNotify((error, _notice) => {\n if (!error && this.props.showUserFeedbackFormOnError) {\n this.props.honeybadger.showUserFeedbackForm();\n }\n });\n }\n componentDidCatch(error, errorInfo) {\n this.setState({ error, info: errorInfo });\n this.props.honeybadger.notify(error, { context: errorInfo });\n }\n getErrorComponent() {\n return this.props.ErrorComponent\n ? React.createElement(this.props.ErrorComponent, { ...this.state })\n : React.createElement(DefaultErrorComponent, { ...this.state });\n }\n render() {\n return (React.createElement(React.Fragment, null, this.state.errorOccurred\n ? this.getErrorComponent()\n : this.props.children));\n }\n}\nHoneybadgerErrorBoundary.defaultProps = {\n showUserFeedbackFormOnError: false\n};\n//# sourceMappingURL=HoneybadgerErrorBoundary.js.map","import Honeybadger from '@honeybadger-io/js';\nimport HoneybadgerErrorBoundary from './HoneybadgerErrorBoundary';\nconst NOTIFIER = {\n name: '@honeybadger-io/react',\n url: 'https://github.com/honeybadger-io/honeybadger-js/tree/master/packages/react',\n version: '__VERSION__'\n};\nHoneybadger.setNotifier(NOTIFIER);\nexport { Honeybadger, HoneybadgerErrorBoundary };\n//# sourceMappingURL=index.js.map"],"names":["React","Component","Honeybadger"],"mappings":";;;;;;;;;;;;AACA,SAAS,qBAAqB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;AAChD,IAAI,QAAQA,yBAAK,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE;AAC7D,QAAQA,yBAAK,CAAC,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE,mBAAmB,CAAC;AAC7D,QAAQA,yBAAK,CAAC,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,GAAG,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC;AACvE,QAAQA,yBAAK,CAAC,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE;AACtF;;ACJe,MAAM,wBAAwB,SAASC,eAAS,CAAC;AAChE,IAAI,WAAW,CAAC,KAAK,EAAE;AACvB,QAAQ,KAAK,CAAC,KAAK,CAAC,CAAC;AACrB,QAAQ,IAAI,CAAC,KAAK,GAAG;AACrB,YAAY,KAAK,EAAE,IAAI;AACvB,YAAY,IAAI,EAAE,IAAI;AACtB,YAAY,aAAa,EAAE,KAAK;AAChC,SAAS,CAAC;AACV,KAAK;AACL,IAAI,OAAO,wBAAwB,CAAC,KAAK,EAAE;AAC3C,QAAQ,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AACjE,KAAK;AACL,IAAI,iBAAiB,GAAG;AACxB,QAAQ,IA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B;AACjC,IAAI,GAAG,EAAE,6EAA6E;AACtF,IAAI,OAAO,EAAE,QAAY;AACzB,CAAC,CAAA;AACDE,+BAAW,CAAC,WAAW,CAAC,QAAQ,CAAC;;;;;;;;"}
@@ -1,21 +1,13 @@
1
1
  import Honeybadger from '@honeybadger-io/js';
2
2
  export { default as Honeybadger } from '@honeybadger-io/js';
3
3
  import React, { Component } from 'react';
4
- import PropTypes from 'prop-types';
5
4
 
6
- // eslint-disable-next-line @typescript-eslint/ban-types
7
- class DefaultErrorComponent extends Component {
8
- render() {
9
- return (React.createElement("div", { className: 'error' },
10
- React.createElement("div", null, "An Error Occurred"),
11
- React.createElement("div", null, JSON.stringify(this.props.error, null, 2)),
12
- React.createElement("div", null, this.props.info ? JSON.stringify(this.props.info, null, 2) : '')));
13
- }
5
+ function DefaultErrorComponent({ error, info }) {
6
+ return (React.createElement("div", { className: 'error' },
7
+ React.createElement("div", null, "An Error Occurred"),
8
+ React.createElement("div", null, error ? error.toString() : ''),
9
+ React.createElement("div", null, info ? JSON.stringify(info, null, 2) : '')));
14
10
  }
15
- DefaultErrorComponent.propTypes = {
16
- error: PropTypes.object,
17
- info: PropTypes.object
18
- };
19
11
 
20
12
  class HoneybadgerErrorBoundary extends Component {
21
13
  constructor(props) {
@@ -25,22 +17,24 @@ class HoneybadgerErrorBoundary extends Component {
25
17
  info: null,
26
18
  errorOccurred: false
27
19
  };
20
+ }
21
+ static getDerivedStateFromError(error) {
22
+ return { error: error, errorOccurred: true, info: null };
23
+ }
24
+ componentDidMount() {
28
25
  this.props.honeybadger.afterNotify((error, _notice) => {
29
26
  if (!error && this.props.showUserFeedbackFormOnError) {
30
27
  this.props.honeybadger.showUserFeedbackForm();
31
28
  }
32
29
  });
33
30
  }
34
- static getDerivedStateFromError(error) {
35
- return { error: error, errorOccurred: true, info: null };
36
- }
37
31
  componentDidCatch(error, errorInfo) {
38
- this.setState({ errorOccurred: true, error: error, info: errorInfo });
32
+ this.setState({ error, info: errorInfo });
39
33
  this.props.honeybadger.notify(error, { context: errorInfo });
40
34
  }
41
35
  getErrorComponent() {
42
36
  return this.props.ErrorComponent
43
- ? React.createElement(this.props.ErrorComponent, this.state)
37
+ ? React.createElement(this.props.ErrorComponent, { ...this.state })
44
38
  : React.createElement(DefaultErrorComponent, { ...this.state });
45
39
  }
46
40
  render() {
@@ -49,12 +43,6 @@ class HoneybadgerErrorBoundary extends Component {
49
43
  : this.props.children));
50
44
  }
51
45
  }
52
- HoneybadgerErrorBoundary.propTypes = {
53
- honeybadger: PropTypes.object.isRequired,
54
- showUserFeedbackFormOnError: PropTypes.bool,
55
- children: PropTypes.element,
56
- ErrorComponent: PropTypes.oneOfType([PropTypes.element, PropTypes.func])
57
- };
58
46
  HoneybadgerErrorBoundary.defaultProps = {
59
47
  showUserFeedbackFormOnError: false
60
48
  };
@@ -62,7 +50,7 @@ HoneybadgerErrorBoundary.defaultProps = {
62
50
  const NOTIFIER = {
63
51
  name: '@honeybadger-io/react',
64
52
  url: 'https://github.com/honeybadger-io/honeybadger-js/tree/master/packages/react',
65
- version: '6.1.25'
53
+ version: '6.1.27'
66
54
  };
67
55
  Honeybadger.setNotifier(NOTIFIER);
68
56
 
@@ -1 +1 @@
1
- {"version":3,"file":"honeybadger-react.esm.js","sources":["../../build/DefaultErrorComponent.js","../../build/HoneybadgerErrorBoundary.js","../../build/index.js"],"sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport default class DefaultErrorComponent extends Component {\n render() {\n return (React.createElement(\"div\", { className: 'error' },\n React.createElement(\"div\", null, \"An Error Occurred\"),\n React.createElement(\"div\", null, JSON.stringify(this.props.error, null, 2)),\n React.createElement(\"div\", null, this.props.info ? JSON.stringify(this.props.info, null, 2) : '')));\n }\n}\nDefaultErrorComponent.propTypes = {\n error: PropTypes.object,\n info: PropTypes.object\n};\n//# sourceMappingURL=DefaultErrorComponent.js.map","import React, { Component } from 'react';\nimport DefaultErrorComponent from './DefaultErrorComponent';\nimport PropTypes from 'prop-types';\nexport default class HoneybadgerErrorBoundary extends Component {\n constructor(props) {\n super(props);\n this.state = {\n error: null,\n info: null,\n errorOccurred: false\n };\n this.props.honeybadger.afterNotify((error, _notice) => {\n if (!error && this.props.showUserFeedbackFormOnError) {\n this.props.honeybadger.showUserFeedbackForm();\n }\n });\n }\n static getDerivedStateFromError(error) {\n return { error: error, errorOccurred: true, info: null };\n }\n componentDidCatch(error, errorInfo) {\n this.setState({ errorOccurred: true, error: error, info: errorInfo });\n this.props.honeybadger.notify(error, { context: errorInfo });\n }\n getErrorComponent() {\n return this.props.ErrorComponent\n ? React.createElement(this.props.ErrorComponent, this.state)\n : React.createElement(DefaultErrorComponent, { ...this.state });\n }\n render() {\n return (React.createElement(React.Fragment, null, this.state.errorOccurred\n ? this.getErrorComponent()\n : this.props.children));\n }\n}\nHoneybadgerErrorBoundary.propTypes = {\n honeybadger: PropTypes.object.isRequired,\n showUserFeedbackFormOnError: PropTypes.bool,\n children: PropTypes.element,\n ErrorComponent: PropTypes.oneOfType([PropTypes.element, PropTypes.func])\n};\nHoneybadgerErrorBoundary.defaultProps = {\n showUserFeedbackFormOnError: false\n};\n//# sourceMappingURL=HoneybadgerErrorBoundary.js.map","import Honeybadger from '@honeybadger-io/js';\nimport HoneybadgerErrorBoundary from './HoneybadgerErrorBoundary';\nconst NOTIFIER = {\n name: '@honeybadger-io/react',\n url: 'https://github.com/honeybadger-io/honeybadger-js/tree/master/packages/react',\n version: '__VERSION__'\n};\nHoneybadger.setNotifier(NOTIFIER);\nexport { Honeybadger, HoneybadgerErrorBoundary };\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;;AAEA;AACe,MAAM,qBAAqB,SAAS,SAAS,CAAC;AAC7D,IAAI,MAAM,GAAG;AACb,QAAQ,QAAQ,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE;AACjE,YAAY,KAAK,CAAC,aAAa,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AAE,KAAK;AACtC,CAAC;;ACzCD,MAAM,QAAQ,GAAG;AACjB,IAAI,IAAI,EAAE,uBAAuB;AACjC,IAAI,GAAG,EAAE,6EAA6E;AACtF,IAAI,OAAO,EAAE,QAAa;AAC1B,CAAC,CAAC;AACF,WAAW,CAAC,WAAW,CAAC,QAAQ,CAAC;;;;"}
1
+ {"version":3,"file":"honeybadger-react.esm.js","sources":["../../build/DefaultErrorComponent.js","../../build/HoneybadgerErrorBoundary.js","../../build/index.js"],"sourcesContent":["import React from 'react';\nfunction DefaultErrorComponent({ error, info }) {\n return (React.createElement(\"div\", { className: 'error' },\n React.createElement(\"div\", null, \"An Error Occurred\"),\n React.createElement(\"div\", null, error ? error.toString() : ''),\n React.createElement(\"div\", null, info ? JSON.stringify(info, null, 2) : '')));\n}\nexport default DefaultErrorComponent;\n//# sourceMappingURL=DefaultErrorComponent.js.map","import React, { Component } from 'react';\nimport DefaultErrorComponent from './DefaultErrorComponent';\nexport default class HoneybadgerErrorBoundary extends Component {\n constructor(props) {\n super(props);\n this.state = {\n error: null,\n info: null,\n errorOccurred: false\n };\n }\n static getDerivedStateFromError(error) {\n return { error: error, errorOccurred: true, info: null };\n }\n componentDidMount() {\n this.props.honeybadger.afterNotify((error, _notice) => {\n if (!error && this.props.showUserFeedbackFormOnError) {\n this.props.honeybadger.showUserFeedbackForm();\n }\n });\n }\n componentDidCatch(error, errorInfo) {\n this.setState({ error, info: errorInfo });\n this.props.honeybadger.notify(error, { context: errorInfo });\n }\n getErrorComponent() {\n return this.props.ErrorComponent\n ? React.createElement(this.props.ErrorComponent, { ...this.state })\n : React.createElement(DefaultErrorComponent, { ...this.state });\n }\n render() {\n return (React.createElement(React.Fragment, null, this.state.errorOccurred\n ? this.getErrorComponent()\n : this.props.children));\n }\n}\nHoneybadgerErrorBoundary.defaultProps = {\n showUserFeedbackFormOnError: false\n};\n//# sourceMappingURL=HoneybadgerErrorBoundary.js.map","import Honeybadger from '@honeybadger-io/js';\nimport HoneybadgerErrorBoundary from './HoneybadgerErrorBoundary';\nconst NOTIFIER = {\n name: '@honeybadger-io/react',\n url: 'https://github.com/honeybadger-io/honeybadger-js/tree/master/packages/react',\n version: '__VERSION__'\n};\nHoneybadger.setNotifier(NOTIFIER);\nexport { Honeybadger, HoneybadgerErrorBoundary };\n//# sourceMappingURL=index.js.map"],"names":[],"mappings":";;;;AACA,SAAS,qBAAqB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;AAChD,IAAI,QAAQ,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE;AAC7D,QAAQ,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE,mBAAmB,CAAC;AAC7D,QAAQ,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,GAAG,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC;AACvE,QAAQ,KAAK,CAAC,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE;AACtF;;ACJe,MAAM,wBAAwB,SAAS,SAAS,CAAC;AAChE,IAAI,WAAW,CAAC,KAAK,EAAE;AACvB,QAAQ,KAAK,CAAC,KAAK,CAAC,CAAC;AACrB,QAAQ,IAAI,CAAC,KAAK,GAAG;AACrB,YAAY,KAAK,EAAE,IAAI;AACvB,YAAY,IAAI,EAAE,IAAI;AACtB,YAAY,aAAa,EAAE,KAAK;AAChC,SAAS,CAAC;AACV,KAAK;AACL,IAAI,OAAO,wBAAwB,CAAC,KAAK,EAAE;AAC3C,QAAQ,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,aAAa,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC;AACjE,KAAK;AACL,IAAI,iBAAiB,GAAG;AACxB,QAAQ,IAAI,CAAC,KAAK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AAE,6EAA6E;AACtF,IAAI,OAAO,EAAE,QAAY;AACzB,CAAC,CAAA;AACD,WAAW,CAAC,WAAW,CAAC,QAAQ,CAAC;;;;"}
@@ -1,25 +1,17 @@
1
- var HoneybadgerReact = (function (exports, Honeybadger, React, PropTypes) {
1
+ var HoneybadgerReact = (function (exports, Honeybadger, React) {
2
2
  'use strict';
3
3
 
4
4
  function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
5
5
 
6
6
  var Honeybadger__default = /*#__PURE__*/_interopDefaultLegacy(Honeybadger);
7
7
  var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
8
- var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
9
8
 
10
- // eslint-disable-next-line @typescript-eslint/ban-types
11
- class DefaultErrorComponent extends React.Component {
12
- render() {
13
- return (React__default["default"].createElement("div", { className: 'error' },
14
- React__default["default"].createElement("div", null, "An Error Occurred"),
15
- React__default["default"].createElement("div", null, JSON.stringify(this.props.error, null, 2)),
16
- React__default["default"].createElement("div", null, this.props.info ? JSON.stringify(this.props.info, null, 2) : '')));
17
- }
9
+ function DefaultErrorComponent({ error, info }) {
10
+ return (React__default["default"].createElement("div", { className: 'error' },
11
+ React__default["default"].createElement("div", null, "An Error Occurred"),
12
+ React__default["default"].createElement("div", null, error ? error.toString() : ''),
13
+ React__default["default"].createElement("div", null, info ? JSON.stringify(info, null, 2) : '')));
18
14
  }
19
- DefaultErrorComponent.propTypes = {
20
- error: PropTypes__default["default"].object,
21
- info: PropTypes__default["default"].object
22
- };
23
15
 
24
16
  class HoneybadgerErrorBoundary extends React.Component {
25
17
  constructor(props) {
@@ -29,22 +21,24 @@ var HoneybadgerReact = (function (exports, Honeybadger, React, PropTypes) {
29
21
  info: null,
30
22
  errorOccurred: false
31
23
  };
24
+ }
25
+ static getDerivedStateFromError(error) {
26
+ return { error: error, errorOccurred: true, info: null };
27
+ }
28
+ componentDidMount() {
32
29
  this.props.honeybadger.afterNotify((error, _notice) => {
33
30
  if (!error && this.props.showUserFeedbackFormOnError) {
34
31
  this.props.honeybadger.showUserFeedbackForm();
35
32
  }
36
33
  });
37
34
  }
38
- static getDerivedStateFromError(error) {
39
- return { error: error, errorOccurred: true, info: null };
40
- }
41
35
  componentDidCatch(error, errorInfo) {
42
- this.setState({ errorOccurred: true, error: error, info: errorInfo });
36
+ this.setState({ error, info: errorInfo });
43
37
  this.props.honeybadger.notify(error, { context: errorInfo });
44
38
  }
45
39
  getErrorComponent() {
46
40
  return this.props.ErrorComponent
47
- ? React__default["default"].createElement(this.props.ErrorComponent, this.state)
41
+ ? React__default["default"].createElement(this.props.ErrorComponent, { ...this.state })
48
42
  : React__default["default"].createElement(DefaultErrorComponent, { ...this.state });
49
43
  }
50
44
  render() {
@@ -53,12 +47,6 @@ var HoneybadgerReact = (function (exports, Honeybadger, React, PropTypes) {
53
47
  : this.props.children));
54
48
  }
55
49
  }
56
- HoneybadgerErrorBoundary.propTypes = {
57
- honeybadger: PropTypes__default["default"].object.isRequired,
58
- showUserFeedbackFormOnError: PropTypes__default["default"].bool,
59
- children: PropTypes__default["default"].element,
60
- ErrorComponent: PropTypes__default["default"].oneOfType([PropTypes__default["default"].element, PropTypes__default["default"].func])
61
- };
62
50
  HoneybadgerErrorBoundary.defaultProps = {
63
51
  showUserFeedbackFormOnError: false
64
52
  };
@@ -66,7 +54,7 @@ var HoneybadgerReact = (function (exports, Honeybadger, React, PropTypes) {
66
54
  const NOTIFIER = {
67
55
  name: '@honeybadger-io/react',
68
56
  url: 'https://github.com/honeybadger-io/honeybadger-js/tree/master/packages/react',
69
- version: '6.1.25'
57
+ version: '6.1.27'
70
58
  };
71
59
  Honeybadger__default["default"].setNotifier(NOTIFIER);
72
60
 
@@ -80,5 +68,5 @@ var HoneybadgerReact = (function (exports, Honeybadger, React, PropTypes) {
80
68
 
81
69
  return exports;
82
70
 
83
- })({}, Honeybadger, React, PropTypes);
71
+ })({}, Honeybadger, React);
84
72
  //# sourceMappingURL=honeybadger-react.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"honeybadger-react.js","sources":["../../build/DefaultErrorComponent.js","../../build/HoneybadgerErrorBoundary.js","../../build/index.js"],"sourcesContent":["import React, { Component } from 'react';\nimport PropTypes from 'prop-types';\n// eslint-disable-next-line @typescript-eslint/ban-types\nexport default class DefaultErrorComponent extends Component {\n render() {\n return (React.createElement(\"div\", { className: 'error' },\n React.createElement(\"div\", null, \"An Error Occurred\"),\n React.createElement(\"div\", null, JSON.stringify(this.props.error, null, 2)),\n React.createElement(\"div\", null, this.props.info ? JSON.stringify(this.props.info, null, 2) : '')));\n }\n}\nDefaultErrorComponent.propTypes = {\n error: PropTypes.object,\n info: PropTypes.object\n};\n//# sourceMappingURL=DefaultErrorComponent.js.map","import React, { Component } from 'react';\nimport DefaultErrorComponent from './DefaultErrorComponent';\nimport PropTypes from 'prop-types';\nexport default class HoneybadgerErrorBoundary extends Component {\n constructor(props) {\n super(props);\n this.state = {\n error: null,\n info: null,\n errorOccurred: false\n };\n this.props.honeybadger.afterNotify((error, _notice) => {\n if (!error && this.props.showUserFeedbackFormOnError) {\n this.props.honeybadger.showUserFeedbackForm();\n }\n });\n }\n static getDerivedStateFromError(error) {\n return { error: error, errorOccurred: true, info: null };\n }\n componentDidCatch(error, errorInfo) {\n this.setState({ errorOccurred: true, error: error, info: errorInfo });\n this.props.honeybadger.notify(error, { context: errorInfo });\n }\n getErrorComponent() {\n return this.props.ErrorComponent\n ? React.createElement(this.props.ErrorComponent, this.state)\n : React.createElement(DefaultErrorComponent, { ...this.state });\n }\n render() {\n return (React.createElement(React.Fragment, null, this.state.errorOccurred\n ? this.getErrorComponent()\n : this.props.children));\n }\n}\nHoneybadgerErrorBoundary.propTypes = {\n honeybadger: PropTypes.object.isRequired,\n showUserFeedbackFormOnError: PropTypes.bool,\n children: PropTypes.element,\n ErrorComponent: PropTypes.oneOfType([PropTypes.element, PropTypes.func])\n};\nHoneybadgerErrorBoundary.defaultProps = {\n showUserFeedbackFormOnError: false\n};\n//# sourceMappingURL=HoneybadgerErrorBoundary.js.map","import Honeybadger from '@honeybadger-io/js';\nimport HoneybadgerErrorBoundary from './HoneybadgerErrorBoundary';\nconst NOTIFIER = {\n name: '@honeybadger-io/react',\n url: 'https://github.com/honeybadger-io/honeybadger-js/tree/master/packages/react',\n version: '__VERSION__'\n};\nHoneybadger.setNotifier(NOTIFIER);\nexport { Honeybadger, HoneybadgerErrorBoundary };\n//# sourceMappingURL=index.js.map"],"names":["Component","React","PropTypes","Honeybadger"],"mappings":";;;;;;;;;IAEA;IACe,MAAM,qBAAqB,SAASA,eAAS,CAAC;IAC7D,IAAI,MAAM,GAAG;IACb,QAAQ,QAAQC,yBAAK,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE;IACjE,YAAYA,yBAAK,CAAC,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE,mBAAmB,CAAC;IACjE,YAAYA,yBAAK,CAAC,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC;IACvF,YAAYA,yBAAK,CAAC,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE;IAChH,KAAK;IACL,CAAC;IACD,qBAAqB,CAAC,SAAS,GAAG;IAClC,IAAI,KAAK,EAAEC,6BAAS,CAAC,MAAM;IAC3B,IAAI,IAAI,EAAEA,6BAAS,CAAC,MAAM;IAC1B,CAAC;;ICXc,MAAM,wBAAwB,SAASF,eAAS,CAAC;IAChE,IAAI,WAAW,CAAC,KAAK,EAAE;IACvB,QAAQ,KAAK,CAAC,KAAK,CAAC,CAA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AK,CAAC,aAAa,CAACA,yBAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa;IAClF,cAAc,IAAI,CAAC,iBAAiB,EAAE;IACtC,cAAc,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE;IACpC,KAAK;IACL,CAAC;IACD,wBAAwB,CAAC,SAAS,GAAG;IACrC,IAAI,WAAW,EAAEC,6BAAS,CAAC,MAAM,CAAC,UAAU;IAC5C,IAAI,2BAA2B,EAAEA,6BAAS,CAAC,IAAI;IAC/C,IAAI,QAAQ,EAAEA,6BAAS,CAAC,OAAO;IAC/B,IAAI,cAAc,EAAEA,6BAAS,CAAC,SAAS,CAAC,CAACA,6BAAS,CAAC,OAAO,EAAEA,6BAAS,CAAC,IAAI,CAAC,CAAC;IAC5E,CAAC,CAAC;IACF,wBAAwB,CAAC,YAAY,GAAG;IACxC,IAAI,2BAA2B,EAAE,KAAK;IACtC,CAAC;;ICzCD,MAAM,QAAQ,GAAG;IACjB,IAAI,IAAI,EAAE,uBAAuB;IACjC,IAAI,GAAG,EAAE,6EAA6E;IACtF,IAAI,OAAO,EAAE,QAAa;IAC1B,CAAC,CAAC;AACFC,mCAAW,CAAC,WAAW,CAAC,QAAQ,CAAC;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"honeybadger-react.js","sources":["../../build/DefaultErrorComponent.js","../../build/HoneybadgerErrorBoundary.js","../../build/index.js"],"sourcesContent":["import React from 'react';\nfunction DefaultErrorComponent({ error, info }) {\n return (React.createElement(\"div\", { className: 'error' },\n React.createElement(\"div\", null, \"An Error Occurred\"),\n React.createElement(\"div\", null, error ? error.toString() : ''),\n React.createElement(\"div\", null, info ? JSON.stringify(info, null, 2) : '')));\n}\nexport default DefaultErrorComponent;\n//# sourceMappingURL=DefaultErrorComponent.js.map","import React, { Component } from 'react';\nimport DefaultErrorComponent from './DefaultErrorComponent';\nexport default class HoneybadgerErrorBoundary extends Component {\n constructor(props) {\n super(props);\n this.state = {\n error: null,\n info: null,\n errorOccurred: false\n };\n }\n static getDerivedStateFromError(error) {\n return { error: error, errorOccurred: true, info: null };\n }\n componentDidMount() {\n this.props.honeybadger.afterNotify((error, _notice) => {\n if (!error && this.props.showUserFeedbackFormOnError) {\n this.props.honeybadger.showUserFeedbackForm();\n }\n });\n }\n componentDidCatch(error, errorInfo) {\n this.setState({ error, info: errorInfo });\n this.props.honeybadger.notify(error, { context: errorInfo });\n }\n getErrorComponent() {\n return this.props.ErrorComponent\n ? React.createElement(this.props.ErrorComponent, { ...this.state })\n : React.createElement(DefaultErrorComponent, { ...this.state });\n }\n render() {\n return (React.createElement(React.Fragment, null, this.state.errorOccurred\n ? this.getErrorComponent()\n : this.props.children));\n }\n}\nHoneybadgerErrorBoundary.defaultProps = {\n showUserFeedbackFormOnError: false\n};\n//# sourceMappingURL=HoneybadgerErrorBoundary.js.map","import Honeybadger from '@honeybadger-io/js';\nimport HoneybadgerErrorBoundary from './HoneybadgerErrorBoundary';\nconst NOTIFIER = {\n name: '@honeybadger-io/react',\n url: 'https://github.com/honeybadger-io/honeybadger-js/tree/master/packages/react',\n version: '__VERSION__'\n};\nHoneybadger.setNotifier(NOTIFIER);\nexport { Honeybadger, HoneybadgerErrorBoundary };\n//# sourceMappingURL=index.js.map"],"names":["React","Component","Honeybadger"],"mappings":";;;;;;;;IACA,SAAS,qBAAqB,CAAC,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;IAChD,IAAI,QAAQA,yBAAK,CAAC,aAAa,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,OAAO,EAAE;IAC7D,QAAQA,yBAAK,CAAC,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE,mBAAmB,CAAC;IAC7D,QAAQA,yBAAK,CAAC,aAAa,CAAC,KAAK,EAAE,IAAI,EAAE,KAAK,GAAG,KAAK,CAAC,QAAQ,EAAE,GAAG,EAAE,CAAC;IACvE,QAAQA,yBAAK,CAAC,aAAa,CAAC,KAAK,EA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K,CAAC,aAAa,CAAC,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,EAAE,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;IAC/E,cAAcA,yBAAK,CAAC,aAAa,CAAC,qBAAqB,EAAE,EAAE,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC;IAC5E,KAAK;IACL,IAAI,MAAM,GAAG;IACb,QAAQ,QAAQA,yBAAK,CAAC,aAAa,CAACA,yBAAK,CAAC,QAAQ,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,aAAa;IAClF,cAAc,IAAI,CAAC,iBAAiB,EAAE;IACtC,cAAc,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE;IACpC,KAAK;IACL,CAAC;IACD,wBAAwB,CAAC,YAAY,GAAG;IACxC,IAAI,2BAA2B,EAAE,KAAK;IACtC,CAAC;;ICpCD,MAAM,QAAQ,GAAG;IACjB,IAAI,IAAI,EAAE,uBAAuB;IACjC,IAAI,GAAG,EAAE,6EAA6E;IACtF,IAAI,OAAO,EAAE,QAAY;IACzB,CAAC,CAAA;AACDE,mCAAW,CAAC,WAAW,CAAC,QAAQ,CAAC;;;;;;;;;;;;;;;;"}
@@ -1 +1 @@
1
- export {};
1
+ import '@testing-library/jest-dom';
@@ -0,0 +1,14 @@
1
+ import { ComponentType, ElementType, ErrorInfo, PropsWithChildren, ReactNode } from 'react';
2
+ import Honeybadger from '@honeybadger-io/js';
3
+ export type DefaultErrorComponentProps = {
4
+ error: Error | null;
5
+ info: ErrorInfo | null;
6
+ };
7
+ export type HoneybadgerErrorBoundaryProps = PropsWithChildren<{
8
+ honeybadger: typeof Honeybadger;
9
+ showUserFeedbackFormOnError?: boolean;
10
+ ErrorComponent?: ReactNode | ComponentType | ElementType;
11
+ }>;
12
+ export type HoneybadgerErrorBoundaryState = {
13
+ errorOccurred: boolean;
14
+ } & DefaultErrorComponentProps;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@honeybadger-io/react",
3
- "version": "6.1.25",
3
+ "version": "6.1.27",
4
4
  "description": "React.js integration for honeybadger",
5
5
  "author": "Jason Truesdell <jason@yuzuten.com> (https://github.com/JasonTrue)",
6
6
  "license": "MIT",
@@ -15,36 +15,34 @@
15
15
  "unpkg": "dist/honeybadger-react.js",
16
16
  "jsnext:main": "dist/honeybadger-react.esm.js",
17
17
  "scripts": {
18
- "test": "cross-env CI=1 react-scripts test --env=jsdom",
19
- "test:watch": "react-scripts test --env=jsdom",
18
+ "test": "jest",
19
+ "test:watch": "jest --watchAll",
20
20
  "build": "tsc --build tsconfig.json && rollup -c && tsc --build tsconfig.types.json",
21
21
  "start": "rollup -c -w",
22
- "predeploy": "cd example && npm install && npm run build",
23
- "deploy": "gh-pages -d example/build"
22
+ "predeploy": "cd example && npm install && npm run build"
24
23
  },
25
24
  "peerDependencies": {
26
25
  "@honeybadger-io/js": "^6.2.0",
27
- "prop-types": "^15.0.0",
28
- "react": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0",
29
- "react-dom": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0"
26
+ "react": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
27
+ "react-dom": "^15.0.0 || ^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0"
30
28
  },
31
29
  "devDependencies": {
32
- "@honeybadger-io/js": "^6.10.1",
33
30
  "@rollup/plugin-commonjs": "^22.0.0",
34
31
  "@rollup/plugin-replace": "^5.0.2",
32
+ "@testing-library/jest-dom": "^6.6.3",
33
+ "@testing-library/react": "^16.1.0",
35
34
  "@types/jest": "^29.0.0",
36
- "@types/react": "^18.0.0",
37
- "@types/react-test-renderer": "^18.0.0",
35
+ "@types/react": "^19.0.0",
36
+ "@types/react-dom": "^19.0.2",
38
37
  "@types/sinon": "^10.0.11",
39
- "cross-env": "^7.0.0",
40
- "gh-pages": "^4.0.0",
41
38
  "husky": "^8.0.0",
39
+ "jest": "^29.7.0",
40
+ "jest-environment-jsdom": "^29.7.0",
42
41
  "jest-fetch-mock": "^3.0.3",
43
- "react": "^18.1.0",
44
- "react-scripts": "^5.0.1",
45
- "react-test-renderer": "18.1.0",
42
+ "react": "^19.1.0",
46
43
  "rollup": "^2.70.2",
47
44
  "sinon": "^14.0.0",
45
+ "ts-jest": "^29.3.1",
48
46
  "typescript": "^4.6.3"
49
47
  },
50
48
  "files": [
@@ -53,5 +51,5 @@
53
51
  "engines": {
54
52
  "node": ">=14"
55
53
  },
56
- "gitHead": "fb25688d92af4bc404adc525180de42a9adfc4bb"
54
+ "gitHead": "0fb9be8dc958a4add1950fcd8271bef733687e3a"
57
55
  }