diff --git a/package.json b/package.json index 99ef346..f2f5140 100644 --- a/package.json +++ b/package.json @@ -85,5 +85,9 @@ "style": "module", "parser": "typescript" } + }, + "publishConfig": { + "registry": "https://registry.npmjs.org/", + "tag": "latest" } } diff --git a/src/components/ErrorBoundary.ts b/src/components/ErrorBoundary.ts new file mode 100644 index 0000000..09ce307 --- /dev/null +++ b/src/components/ErrorBoundary.ts @@ -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; \ No newline at end of file diff --git a/src/components/index.ts b/src/components/index.ts index fa4cb43..4645947 100755 --- a/src/components/index.ts +++ b/src/components/index.ts @@ -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';