use-error-boundary
Advanced tools
Comparing version 1.2.2 to 1.2.3
{ | ||
"name": "use-error-boundary", | ||
"version": "1.2.2", | ||
"version": "1.2.3", | ||
"description": "React hook for using error boundaries", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -55,19 +55,12 @@ # use-error-boundary | ||
```javascript | ||
const JustRenderMe = () => { | ||
throw new Error('💥') | ||
throw new Error("💥") | ||
} | ||
const MyComponent = () => { | ||
const { ErrorBoundary, didCatch, error } = useErrorBoundary() | ||
const { | ||
ErrorBoundary, | ||
didCatch, | ||
error | ||
} = useErrorBoundary() | ||
return ( | ||
{ | ||
didCatch ? ( | ||
<> | ||
{didCatch ? ( | ||
<p>An error has been catched: {error.message}</p> | ||
@@ -78,4 +71,4 @@ ) : ( | ||
</ErrorBoundary> | ||
) | ||
} | ||
)} | ||
</> | ||
) | ||
@@ -82,0 +75,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30111
116