You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
filepizza/lib/components/ErrorPage.js

35 lines
609 B
JavaScript

import ErrorStore from '../stores/ErrorStore'
import React from 'react'
export default class ErrorPage extends React.Component {
constructor() {
this.state = ErrorStore.getState()
this._onChange = () => {
this.setState(ErrorStore.getState())
}
}
componentDidMount() {
ErrorStore.listen(this._onChange)
}
componentDidUnmount() {
ErrorStore.unlisten(this._onChange)
}
render() {
return <div>
<h1>{this.state.status}</h1>
<p>{this.state.message}</p>
{this.state.stack
? <pre>{this.state.stack}</pre>
: null}
</div>
}
}