import { Empty, helper, Button } from '@feewee/h5app-common'; import { useNavigate, useRouteError } from '@modern-js/runtime/router'; import { useCallback, useEffect } from 'react'; function ErrorBoundary() { const error: any = useRouteError(); const navigate = useNavigate(); const lisFn = useCallback((e: any) => { if ('hardwareBackPress' == e.data) { helper.checkBack(() => navigate(-1)); } }, []); useEffect(() => { window.document.addEventListener('message', lisFn); return () => { window.document.removeEventListener('message', lisFn); }; }, []); return (
); } export default ErrorBoundary;