Day-06
โ Error Handling in Next.js
๐ Page Level Error.js page create work as error fallback.
๐ Error.js Page two props returnerror object and reset fn.
๐ error return digest number so easy to find error with same digest number
๐ If this error happens randomly, just refresh the page โ it normally resolves it.
๐ If Server Side Error Page Refresh using StartTransition(()=>{}) give the callback and inside callback call reset fn. and refresh fn from next/navigation
๐ If Client Side Error Page Refresh using directlyStartTransition(()=>{}) reset fn. provide by error props
๐ error page in auto wrapped on nested child component
โ Global Error Boundary in Next.js
๐ app root level create global-error.js/jsx file and export default.
๐ same work like pages error page but etc catch layout error.
๐ this page return full html page not only div etc. becaus etc not wrapped in layout etc parent of layout.
๐it's not catch on development mode only work on production mode.
๐not work any routes function by next js. pure js code work