import React, { useState } from 'react'; import { Alert, Button } from 'antd'; const { ErrorBoundary } = Alert; const ThrowError: React.FC = () => { const [error, setError] = useState(); const onClick = () => { setError(new Error('An Uncaught Error')); }; if (error) { throw error; } return ( ); }; const App: React.FC = () => ( ); export default App;