source dump of claude code
at main 28 lines 487 B view raw
1import * as React from 'react' 2 3interface Props { 4 children: React.ReactNode 5} 6 7interface State { 8 hasError: boolean 9} 10 11export class SentryErrorBoundary extends React.Component<Props, State> { 12 constructor(props: Props) { 13 super(props) 14 this.state = { hasError: false } 15 } 16 17 static getDerivedStateFromError(): State { 18 return { hasError: true } 19 } 20 21 render(): React.ReactNode { 22 if (this.state.hasError) { 23 return null 24 } 25 26 return this.props.children 27 } 28}