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