Skip to content

Commit

Permalink
feat(components): add ErrorBoundary
Browse files Browse the repository at this point in the history
  • Loading branch information
AAGaming00 committed Jun 27, 2024
1 parent 58e3d35 commit dcdbb2d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,5 +85,9 @@
"style": "module",
"parser": "typescript"
}
},
"publishConfig": {
"registry": "https://registry.npmjs.org/",
"tag": "latest"
}
}
6 changes: 6 additions & 0 deletions src/components/ErrorBoundary.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { Component, PropsWithChildren } from "react";
import { findModuleExport } from "../webpack";

export const ErrorBoundary = findModuleExport(
(e) => e.InstallErrorReportingStore && e?.prototype?.Reset && e?.prototype?.componentDidCatch,
) as Component<PropsWithChildren>;
1 change: 1 addition & 0 deletions src/components/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export * from './ControlsList';
export * from './Dialog';
export * from './DialogCheckbox';
export * from './Dropdown';
export * from './ErrorBoundary';
export * from './Field';
export * from './Focusable';
export * from './FocusRing';
Expand Down

0 comments on commit dcdbb2d

Please sign in to comment.