-
Notifications
You must be signed in to change notification settings - Fork 1
Error Boundary #213
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
Error Boundary #213
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds an ErrorBoundary component to the atomic-elements package, providing error handling capabilities for React applications. The ErrorBoundary component allows developers to catch JavaScript errors in their component tree, display fallback UI, and optionally reset the error state.
Key Changes:
- Added new ErrorBoundary component with support for static and functional fallback UI
- Includes comprehensive test coverage and Storybook documentation
- Version bumped from 3.5.x to 3.6.0 for atomic-elements and updated forms package dependency
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/atomic-elements/src/components/Feedback/ErrorBoundary/ErrorBoundary.component.tsx | Core ErrorBoundary implementation as a React class component with error catching, reset functionality, and resetKeys support |
| packages/atomic-elements/src/components/Feedback/ErrorBoundary/index.tsx | Public exports for ErrorBoundary component and types |
| packages/atomic-elements/src/components/Feedback/ErrorBoundary/ErrorBoundary.spec.tsx | Comprehensive test suite covering error catching, fallback rendering, reset functionality, and resetKeys behavior |
| packages/atomic-elements/src/components/Feedback/ErrorBoundary/ErrorBoundary.stories.tsx | Storybook stories demonstrating various ErrorBoundary use cases including static/function fallbacks, resetKeys, and nested boundaries |
| packages/atomic-elements/src/components/index.ts | Added ErrorBoundary exports to main component index |
| packages/atomic-elements/package.json | Version bump to 3.6.0 |
| packages/atomic-elements/CHANGELOG.md | Added 3.6.0 release notes |
| packages/forms/package.json | Updated atomic-elements dependency to ^3.6.0 and version bump to 3.6.0 |
| packages/forms/CHANGELOG.md | Documented version update (though labeled as 4.0.0) |
| CLAUDE.md | Added comprehensive repository documentation for Claude Code |
packages/atomic-elements/src/components/Feedback/ErrorBoundary/ErrorBoundary.component.tsx
Show resolved
Hide resolved
packages/atomic-elements/src/components/Feedback/ErrorBoundary/ErrorBoundary.component.tsx
Outdated
Show resolved
Hide resolved
3c0dac2 to
40e4a86
Compare
Adds a geneeric ErrorBoundary component
Static Fallback
The simplest usage is with a static fallback UI:
Function Fallback
For more dynamic error handling, use a function fallback: