Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ErrorBoundary documentation issue #566

Closed
Brendan-csel opened this issue Jul 17, 2021 · 0 comments
Closed

ErrorBoundary documentation issue #566

Brendan-csel opened this issue Jul 17, 2021 · 0 comments

Comments

@Brendan-csel
Copy link

Describe the bug
The documentation suggests the ErrorBoundary callback form provides a printable error message...

<ErrorBoundary fallback={(err, reset) => <div onClick={reset}>Error: {err}</div>}>
  <MyComp />
</ErrorBoundary>

...however the err parameter is actually an error object which requires err.toString() to show a useful message...

<ErrorBoundary fallback={(err, reset) => <div onClick={reset}>Error: {err.toString()}</div>}>
  <MyComp />
</ErrorBoundary>

To Reproduce
Example with solution. Remove .toString() to see the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant