⚠️ This package is currently under development and not yet ready for production use. Please ⭐️ the repository and check back soon for updates!
A lightweight and customizable error boundary component for React applications. Gracefully catch and display runtime errors in your UI — with zero configuration and full flexibility.
We're actively working to finalize and publish this package. Expect improvements, breaking changes, and feature additions in upcoming releases.
If you'd like to contribute or follow progress:
- 📂 Repository
- 🐛 Report Issues
- ⭐ Star the repo to stay updated!
Coming soon via npm or yarn:
npm install react-smart-error-boundary
# or
yarn add react-smart-error-boundary
import { ErrorBoundary } from 'react-smart-error-boundary';
function App() {
return (
<ErrorBoundary
fallback={(error, info) => (
<div style={{ padding: '1rem', background: '#ffe5e5', color: '#a00' }}>
<h2>🚨 Error: {error.message}</h2>
<details>
<summary>Stack Trace</summary>
<pre>{info.componentStack}</pre>
</details>
</div>
)}
>
<YourComponent />
</ErrorBoundary>
);
}
Prop | Type | Description |
---|---|---|
children |
ReactNode |
Child components that should be protected. |
fallback |
ReactNode or (error: Error, info: React.ErrorInfo) => ReactNode |
Custom UI to render when an error occurs. |
onError |
(error: Error, info: React.ErrorInfo) => void |
Callback for logging or reporting the error. |
- ⚙️ Support for React 17 & 18
- 🎨 Fully customizable fallback UI
- 🧠 Supports static and dynamic fallback rendering
- 💡 Written in TypeScript
- 💼 Production-ready best practices
MIT © Akshay Panchivala
We welcome contributions once development stabilizes. Feel free to open issues or submit a PR in the future.
Made with ❤️ by Akshay Panchivala