1uphealth / fhir-react

FHIR React Component Library
MIT License
99 stars 30 forks source link

Convert `ErrorBoundary` component from class-based to functional #399

Open jocelynn1uphealth opened 1 year ago

jocelynn1uphealth commented 1 year ago

Background:

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

Expected Behavior:

kvaithin commented 1 year ago

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 commented 1 year ago

Addressed this and #398 in https://github.com/1uphealth/fhir-react/pull/404