MCPcopy Create free account
hub / github.com/CodeWithHarry/Sigma-Web-Dev-Course / Error

Function Error

Video 128/dynamic-routes/app/error.js:5–24  ·  view source on GitHub ↗
({ error, reset })

Source from the content-addressed store, hash-verified

3import { useEffect } from 'react'
4
5export 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}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected