ErrorAlertFallback
Usage
import { ErrorBoundary } from "react-error-boundary";
import { ErrorAlertFallback } from "@olenbetong/appframe-mui";
function MyComponent() {
return (
<ErrorBoundary FallbackComponent={ErrorAlertFallback} key={periodType}>
<SomeComponentThatCanThrowAnError />
</ErrorBoundary>
);
}import { useError } from "@olenbetong/appframe-react";
import { ErrorAlertFallback } from "@olenbetong/appframe-mui";
function DataObjectError() {
let error = useError(dsMyDataObject);
return error ? <ErrorAlertFallback error={error} /> : null;
}Last updated
Was this helpful?