From c42ac125a7d52929507e98bedf54120b00d3e5aa Mon Sep 17 00:00:00 2001 From: Marcell Monteiro Cruz <0000marcell@gmail.com> Date: Mon, 30 Nov 2020 13:06:04 +0000 Subject: [PATCH 1/5] Update error-boundaries.md --- content/docs/error-boundaries.md | 1 + 1 file changed, 1 insertion(+) diff --git a/content/docs/error-boundaries.md b/content/docs/error-boundaries.md index ecfa8409c43..7f5354ae3ed 100644 --- a/content/docs/error-boundaries.md +++ b/content/docs/error-boundaries.md @@ -21,6 +21,7 @@ Error boundaries are React components that **catch JavaScript errors anywhere in > * Asynchronous code (e.g. `setTimeout` or `requestAnimationFrame` callbacks) > * Server side rendering > * Errors thrown in the error boundary itself (rather than its children) +> * Error Bounderies only work in production mode, in development the app will be ummounted after showing the fallback ui A class component becomes an error boundary if it defines either (or both) of the lifecycle methods [`static getDerivedStateFromError()`](/docs/react-component.html#static-getderivedstatefromerror) or [`componentDidCatch()`](/docs/react-component.html#componentdidcatch). Use `static getDerivedStateFromError()` to render a fallback UI after an error has been thrown. Use `componentDidCatch()` to log error information. From e938f6e6708cec32f95d515c8bf92beaa46616a3 Mon Sep 17 00:00:00 2001 From: Marcell Monteiro Cruz <0000marcell@gmail.com> Date: Thu, 3 Dec 2020 13:00:00 +0000 Subject: [PATCH 2/5] Update error-boundaries.md --- content/docs/error-boundaries.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/content/docs/error-boundaries.md b/content/docs/error-boundaries.md index 7f5354ae3ed..5339a061f30 100644 --- a/content/docs/error-boundaries.md +++ b/content/docs/error-boundaries.md @@ -21,7 +21,9 @@ Error boundaries are React components that **catch JavaScript errors anywhere in > * Asynchronous code (e.g. `setTimeout` or `requestAnimationFrame` callbacks) > * Server side rendering > * Errors thrown in the error boundary itself (rather than its children) -> * Error Bounderies only work in production mode, in development the app will be ummounted after showing the fallback ui + +> Note +> In development an error overlay will be shown on top of the screen reguardless if you're using error boundaries or not, you can close the overlay and press esc A class component becomes an error boundary if it defines either (or both) of the lifecycle methods [`static getDerivedStateFromError()`](/docs/react-component.html#static-getderivedstatefromerror) or [`componentDidCatch()`](/docs/react-component.html#componentdidcatch). Use `static getDerivedStateFromError()` to render a fallback UI after an error has been thrown. Use `componentDidCatch()` to log error information. From 67ce4effd78801d0364a5f6834c278e54d597e3f Mon Sep 17 00:00:00 2001 From: Marcell Monteiro Cruz <0000marcell@gmail.com> Date: Thu, 3 Dec 2020 13:01:58 +0000 Subject: [PATCH 3/5] Update error-boundaries.md --- content/docs/error-boundaries.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/content/docs/error-boundaries.md b/content/docs/error-boundaries.md index 5339a061f30..01938a46776 100644 --- a/content/docs/error-boundaries.md +++ b/content/docs/error-boundaries.md @@ -22,8 +22,7 @@ Error boundaries are React components that **catch JavaScript errors anywhere in > * Server side rendering > * Errors thrown in the error boundary itself (rather than its children) -> Note -> In development an error overlay will be shown on top of the screen reguardless if you're using error boundaries or not, you can close the overlay and press esc +> In development an error overlay will be shown on top of the screen reguardless if you're using error boundaries or not, you can close the overlay by pressing esc A class component becomes an error boundary if it defines either (or both) of the lifecycle methods [`static getDerivedStateFromError()`](/docs/react-component.html#static-getderivedstatefromerror) or [`componentDidCatch()`](/docs/react-component.html#componentdidcatch). Use `static getDerivedStateFromError()` to render a fallback UI after an error has been thrown. Use `componentDidCatch()` to log error information. From 5158d193476d4c93618dd318ccc9634ec0913f58 Mon Sep 17 00:00:00 2001 From: Marcell Monteiro Cruz <0000marcell@gmail.com> Date: Tue, 8 Dec 2020 14:12:07 +0000 Subject: [PATCH 4/5] Update error-boundaries.md --- content/docs/error-boundaries.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/error-boundaries.md b/content/docs/error-boundaries.md index 01938a46776..fc637c92be7 100644 --- a/content/docs/error-boundaries.md +++ b/content/docs/error-boundaries.md @@ -22,7 +22,7 @@ Error boundaries are React components that **catch JavaScript errors anywhere in > * Server side rendering > * Errors thrown in the error boundary itself (rather than its children) -> In development an error overlay will be shown on top of the screen reguardless if you're using error boundaries or not, you can close the overlay by pressing esc +> In development an error overlay might be shown on top of the screen regardless if you're using error boundaries or not, create-react-app and nextjs implement this error overlay A class component becomes an error boundary if it defines either (or both) of the lifecycle methods [`static getDerivedStateFromError()`](/docs/react-component.html#static-getderivedstatefromerror) or [`componentDidCatch()`](/docs/react-component.html#componentdidcatch). Use `static getDerivedStateFromError()` to render a fallback UI after an error has been thrown. Use `componentDidCatch()` to log error information. From 214360c225e23d8d7d94c9501a5aececc5f9c187 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Tue, 8 Dec 2020 16:56:25 +0100 Subject: [PATCH 5/5] Update content/docs/error-boundaries.md --- content/docs/error-boundaries.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/docs/error-boundaries.md b/content/docs/error-boundaries.md index fc637c92be7..e469211749c 100644 --- a/content/docs/error-boundaries.md +++ b/content/docs/error-boundaries.md @@ -22,7 +22,7 @@ Error boundaries are React components that **catch JavaScript errors anywhere in > * Server side rendering > * Errors thrown in the error boundary itself (rather than its children) -> In development an error overlay might be shown on top of the screen regardless if you're using error boundaries or not, create-react-app and nextjs implement this error overlay +> In development an error overlay might be shown on top of the screen regardless if you're using error boundaries or not. For example, create-react-app and nextjs implement this error overlay. A class component becomes an error boundary if it defines either (or both) of the lifecycle methods [`static getDerivedStateFromError()`](/docs/react-component.html#static-getderivedstatefromerror) or [`componentDidCatch()`](/docs/react-component.html#componentdidcatch). Use `static getDerivedStateFromError()` to render a fallback UI after an error has been thrown. Use `componentDidCatch()` to log error information.