Merge pull request 'fix(build): app global-error fallback pour Next 16 prerender' (#9) from fix/sys-12-global-error-v2 into main
Merge fix Next 16 global-error fallback
This commit is contained in:
commit
9f3eda8bb4
1 changed files with 28 additions and 0 deletions
28
src/app/global-error.tsx
Normal file
28
src/app/global-error.tsx
Normal file
|
|
@ -0,0 +1,28 @@
|
|||
'use client';
|
||||
|
||||
import { useEffect } from 'react';
|
||||
|
||||
type GlobalErrorProps = {
|
||||
error: Error & { digest?: string };
|
||||
reset: () => void;
|
||||
};
|
||||
|
||||
export default function GlobalError({ error, reset }: GlobalErrorProps) {
|
||||
useEffect(() => {
|
||||
console.error(error);
|
||||
}, [error]);
|
||||
|
||||
return (
|
||||
<html lang="fr">
|
||||
<body>
|
||||
<main style={{ padding: 24, fontFamily: 'system-ui, sans-serif' }}>
|
||||
<h1>Une erreur inattendue est survenue</h1>
|
||||
<p>Veuillez reessayer.</p>
|
||||
<button type="button" onClick={reset}>
|
||||
Reessayer
|
||||
</button>
|
||||
</main>
|
||||
</body>
|
||||
</html>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue