({ error, reset })
| 3 | import { useEffect } from 'react' |
| 4 | |
| 5 | export default function Error({ error, reset }) { |
| 6 | useEffect(() => { |
| 7 | // Log the error to an error reporting service |
| 8 | console.error(error) |
| 9 | }, [error]) |
| 10 | |
| 11 | return ( |
| 12 | <div> |
| 13 | <h2>Something went wrong!</h2> |
| 14 | <button |
| 15 | onClick={ |
| 16 | // Attempt to recover by trying to re-render the segment |
| 17 | () => reset() |
| 18 | } |
| 19 | > |
| 20 | Try again |
| 21 | </button> |
| 22 | </div> |
| 23 | ) |
| 24 | } |
nothing calls this directly
no outgoing calls
no test coverage detected