diff --git a/src/components/reps/value-renderer.jsx b/src/components/reps/value-renderer.jsx index e4e7a927dd..4532b8654a 100644 --- a/src/components/reps/value-renderer.jsx +++ b/src/components/reps/value-renderer.jsx @@ -11,8 +11,35 @@ export default class ValueRenderer extends React.Component { valueToRender: PropTypes.any }; + constructor(props) { + super(props); + this.state = {}; + } + + componentDidCatch(error, errorInfo) { + this.setState({ error, errorInfo }); + } + render() { const value = this.props.valueToRender; + + if (this.state.errorInfo) { + return ( +
{value.toString()}+
+ {this.state.error && this.state.error.toString()} ++ + Please file a bug report. + +
+ {this.state.errorInfo.componentStack} +