26 lines
673 B
TypeScript
26 lines
673 B
TypeScript
import { Button } from "@/components/ui/button"
|
|
import { ComposedChart } from "@/components/ui/composedchart.tsx";
|
|
|
|
import { ErrorBoundary, FallbackProps } from "react-error-boundary";
|
|
|
|
function Fallback(fallbackProps: FallbackProps) {
|
|
return (
|
|
<div role="alert">
|
|
<p>Something went wrong:</p>
|
|
<pre style={{ color: "red" }}>{fallbackProps.error.message}</pre>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
function App() {
|
|
return (
|
|
<>
|
|
<ErrorBoundary fallbackRender={Fallback}>
|
|
<ComposedChart></ComposedChart>
|
|
<Button>Click me</Button>
|
|
</ErrorBoundary>
|
|
</>
|
|
)
|
|
}
|
|
|
|
export default App |