
Research
NPM targeted by malware campaign mimicking familiar library names
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.
error-boundary-jsx
Advanced tools
Handle errors on wrapped component and provide a fall back.
yarn add error-boundary-jsx
# or with npm
npm install error-boundary-jsx --save
<ErrorBoundary />
Component (Recommended)Handle errors for specific use case of component.
import ErrorBoundary from 'error-boundary-jsx'
<ErrorBoundary onError={componentErrorHandler} name="component name" FallbackComponent={CustomFallbackComponent}>
...component tree to handle errors
</ErrorBoundary>
withErrorBoundary()
HOCHOC for error handling every use case of a component.
import withErrorBoundary from 'error-boundary-jsx'
const componentErrorHandler = {
handleComponentError(error: Error, name: string, stack: string): void {
...log error
}
}
withErrorBoundary(Component, componentErrorHandler)
prop | type | required | defaultValue | Description |
---|---|---|---|---|
component | React.ComponentType | true | - | A component that we want to bind error boundary jsx to |
name | string | true | - | Component name to identify in stack message |
onError | (name: string, error: Error, stack: string) => void | true | - | Error callback handler |
FallbackComponent | React.ComponentType | false | - | A fallback component when error occurs |
FAQs
React (JS) string formatting
We found that error-boundary-jsx demonstrated a not healthy version release cadence and project activity because the last version was released 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
Socket uncovered npm malware campaign mimicking popular Node.js libraries and packages from other ecosystems; packages steal data and execute remote code.
Research
Socket's research uncovers three dangerous Go modules that contain obfuscated disk-wiping malware, threatening complete data loss.
Research
Socket uncovers malicious packages on PyPI using Gmail's SMTP protocol for command and control (C2) to exfiltrate data and execute commands.