πŸ“„ File detail

components/SentryErrorBoundary.ts

🧩 .tsπŸ“ 29 linesπŸ’Ύ 487 bytesπŸ“ text
← Back to All Files

🎯 Use case

This file lives under β€œcomponents/”, which covers shared React UI pieces. On the API surface it exposes SentryErrorBoundary β€” mainly types, interfaces, or factory objects. Dependencies touch React UI.

Generated from folder role, exports, dependency roots, and inline comments β€” not hand-reviewed for every path.

🧠 Inline summary

import * as React from 'react' interface Props { children: React.ReactNode }

πŸ“€ Exports (heuristic)

  • SentryErrorBoundary

πŸ“š External import roots

Package roots from from "…" (relative paths omitted).

  • react

πŸ–₯️ Source preview

import * as React from 'react'

interface Props {
  children: React.ReactNode
}

interface State {
  hasError: boolean
}

export class SentryErrorBoundary extends React.Component<Props, State> {
  constructor(props: Props) {
    super(props)
    this.state = { hasError: false }
  }

  static getDerivedStateFromError(): State {
    return { hasError: true }
  }

  render(): React.ReactNode {
    if (this.state.hasError) {
      return null
    }

    return this.props.children
  }
}