Proyectos de Subversion LeadersLinked - SPA

Rev

Rev 2206 | Rev 2284 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 2206 Rev 2209
Línea 2... Línea 2...
2
import { connect } from 'react-redux'
2
import { connect } from 'react-redux'
Línea 3... Línea 3...
3
 
3
 
Línea 4... Línea 4...
4
import { addNotification } from '@app/redux/notification/notification.actions'
4
import { addNotification } from '@app/redux/notification/notification.actions'
-
 
5
 
-
 
6
class ErrorBoundary extends React.Component {
-
 
7
  constructor(props) {
-
 
8
    super(props)
-
 
9
    this.state = { hasError: false }
-
 
10
  }
-
 
11
 
-
 
12
  static getDerivedStateFromError() {
-
 
13
    return { hasError: true }
5
 
14
  }
6
class ErrorBoundary extends React.Component {
-
 
7
  componentDidCatch(error, errorInfo) {
15
 
8
    console.log('Error message', error.message)
16
  componentDidCatch(error, errorInfo) {
9
    console.log('ErrorBoundary caught an error: ', error, errorInfo)
17
    console.error('ErrorBoundary caught an error: ', error, errorInfo)
Línea 10... Línea 18...
10
    this.props.addNotification({ style: 'danger', msg: 'Fatal error' })
18
    this.props.addNotification({ style: 'danger', msg: error.message })
11
  }
19
  }
12
 
20
 
13
  render() {
21
  render() {
Línea -... Línea 22...
-
 
22
    return this.props.children
-
 
23
  }
-
 
24
}
-
 
25
 
14
    return this.props.children
26
const mapDispatchToProps = {