Skip to content

docs: document prod vs dev behavior difference in componentDidCatch - #2168

Merged
eps1lon merged 1 commit into
reactjs:masterfrom
FezVrasta:patch-1
Nov 14, 2020
Merged

eps1lon merged 1 commit into
reactjs:masterfrom
FezVrasta:patch-1

Conversation

@FezVrasta

Copy link
Copy Markdown
Contributor

This PR aims to document the componentDidCatch() behavior described by @gaearon in this comment.

I may use some help with the wording of this new paragraph.

@reactjs-bot

Copy link
Copy Markdown

Deploy preview for reactjs ready!

Built with commit 774f5d8

https://deploy-preview-2168--reactjs.netlify.com

@alexkrolick
alexkrolick requested a review from gaearon July 25, 2019 16:53
@FezVrasta

Copy link
Copy Markdown
Contributor Author

What's the process to get this PR merged?

@FezVrasta

Copy link
Copy Markdown
Contributor Author

Is there any way to get this PR merged? Do you accept contributions?

@anton164

Copy link
Copy Markdown

I was confused by this, would be nice to see this merged!

@Jayphen Jayphen left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I approve of this change

@WNemencha WNemencha left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I approve these changes (thx Twitter lol)

@dkempner dkempner left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mkascel

mkascel commented Apr 2, 2020

Copy link
Copy Markdown

Could we move this documentation merge forward or what is blocking here? Until then anyone integrating third-party logging will be wasting time wondering why their ErrorBoundary implementations are silently failing in development due to React's development 'trick' as described here

@sinharaksh1t

Copy link
Copy Markdown

Wow, it's been over a year. All checks have passed but this PR still remains stagnant. 😞

@eps1lon eps1lon left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Re-discovered it since it came up on twitter (again). Much better to link to official documentation than comments spread over GitHub issues.

Documentation can be improved with a rationale or documentation of common error handling patterns. But having a documentation for the "what" is already a big step, thanks!

@eps1lon
eps1lon merged commit eafba20 into reactjs:master Nov 14, 2020
@FezVrasta
FezVrasta deleted the patch-1 branch November 14, 2020 13:19
@OliverJAsh

Copy link
Copy Markdown
Contributor

Glad to see this is now documented. As a next step, I would like to suggest that React should not re-throw errors which are caught by boundaries (in development)—it's very surprising behaviour. I filed an issue: react/react#19613

}
```

Production and development builds of React slightly differ in the way `componentDidCatch()` handles errors.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wasted 2 hours trying to debug this... 💀

just realised it was all working fine

@OliverJAsh

Copy link
Copy Markdown
Contributor

I think this needs to be updated in light of the changes to error handling in React 19. The current docs suggest errors bubble up to window in development, which doesn't seem to be the case anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.