Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
componentDidCatch(error, info) {
console.error(error, info)
Sentry.withScope(scope => {
scope.setExtra('componentStack', info.componentStack)
scope.setTag('area', 'poi')
const eventId = Sentry.captureException(error)
this.setState({
hasError: true,
error,
info,
eventId,
})
})
}