An error boundary component which sends your logs to Sentry and Loggly.
import React from "react"
import ReactDOM from "react-dom"
import LoggingErrorBoundary from "react-logging-error-boundary"
import GivesError from "./GivesError"
import { ErrorPage } from "./ErrorPage"
function App() {
return (
<div className="App">
<LoggingErrorBoundary
logService={{
sentry: {
dsn: "your sentry dsn"
},
loggly: { logglyKey: "your loggly key" }
}}
errorComponent={<ErrorPage />}
>
<GivesError />
</LoggingErrorBoundary>
</div>
)
}
ReactDOM.render(<App />, document.getElementById("root"))
Property | Type | Required | Description |
---|---|---|---|
logService |
object | no | object that contains your sentry and/or loggly configs |
errorComponent |
component | yes | If something is broken users will see this instead of red box |