
Research
/Security News
DuckDB npm Account Compromised in Continuing Supply Chain Attack
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
rinshad-react-guard
Advanced tools
A robust React error boundary solution developed by [rinshad.com](https://rinshad.com) to elegantly handle runtime errors in React applications. Instead of showing the dreaded white screen of death, this library captures errors and displays a user-friendl
A robust React error boundary solution developed by rinshad.com to elegantly handle runtime errors in React applications. Instead of showing the dreaded white screen of death, this library captures errors and displays a user-friendly error page while storing error details in session storage.
npm install rinshad-react-guard
or
yarn add rinshad-react-guard
Try it live: Demo Project
Wrap your app's root component with the ErrorBoundary component:
import ErrorBoundary from 'rinshad-react-guard';
function App() {
return (
<ErrorBoundary>
<YourApp />
</ErrorBoundary>
);
}
You can exclude certain errors from being caught by providing keywords:
import ErrorBoundary from 'rinshad-react-guard';
function App() {
const excludedKeywords = ['ChunkLoadError', 'NetworkError'];
return (
<ErrorBoundary excludedKeywords={excludedKeywords}>
<YourApp />
</ErrorBoundary>
);
}
Error messages are automatically stored in session storage with the key rinshadReactGuardAlert
. You can access them programmatically:
const errorMessage = sessionStorage.getItem('rinshadReactGuardAlert');
Prop | Type | Default | Description |
---|---|---|---|
children | ReactNode | required | The components to be wrapped by the error boundary |
excludedKeywords | string[] | [] | Array of keywords to exclude from error catching |
// main.jsx or App.jsx
import React from 'react';
import ErrorBoundary from 'rinshad-react-guard';
import YourApp from './YourApp';
function App() {
const excludedKeywords = ['ChunkLoadError'];
return (
<ErrorBoundary excludedKeywords={excludedKeywords}>
<YourApp />
</ErrorBoundary>
);
}
export default App;
MIT License
For support, email rinshadcm34@gmail.com
Made with ❤️ by rinshad.com
FAQs
A robust React error boundary solution developed by [rinshad.com](https://rinshad.com) to elegantly handle runtime errors in React applications. Instead of showing the dreaded white screen of death, this library captures errors and displays a user-friendl
We found that rinshad-react-guard demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.
Product
Socket’s new Pull Request Stories give security teams clear visibility into dependency risks and outcomes across scanned pull requests.