error-fallback.tsx 726 B

123456789101112131415161718192021222324252627282930
  1. import { Button, Result } from 'antd';
  2. import React from 'react';
  3. import './error-fallback.less';
  4. interface ErrorFallbackProps {
  5. errorInfo?: string;
  6. error?: any;
  7. }
  8. const ErrorFallback: React.FC<ErrorFallbackProps> = ({ error, errorInfo }) => {
  9. return (
  10. <Result
  11. status="500"
  12. title="500"
  13. subTitle="Sorry, something went wrong."
  14. extra={
  15. <Button
  16. danger
  17. type="primary"
  18. onClick={() => {
  19. window.location.reload();
  20. }}>
  21. 刷新页面
  22. </Button>
  23. }
  24. />
  25. );
  26. };
  27. export default ErrorFallback;