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

Convert ErrorBoundary component from class-based to functional #399

Open
jocelynn1uphealth opened this issue Mar 24, 2023 · 2 comments
Open
Labels
good first issue Good for newcomers

Comments

@jocelynn1uphealth
Copy link
Contributor

Background:

We want to improve the bundle size and performance of this library and write modern React code.

Expected Behavior:

  • No user-facing changes should result from this change
  • The ErrorBoundary class has been removed and replaced with a functional component of the same name
  • The ErrorBoundary component is in its own file
  • stories + documentation have been updated
  • nothing breaks
@jocelynn1uphealth jocelynn1uphealth added the good first issue Good for newcomers label Mar 24, 2023
@kvaithin
Copy link

Hi @jocelynn1uphealth .

This class uses componentDidCatch and there is no equivalent hook available yet.

Based on this closed discussion, doesn't look like an equivalent hook is coming.
https://www.npmjs.com/package/react-error-boundary

Alternatively could consider an additional dependency like the following to support this.
https://www.npmjs.com/package/react-error-boundary

Let me know your thoughts.

@patrick-1upHealth
Copy link

Addressed this and #398 in #404

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Development

No branches or pull requests

3 participants