()
| 149 | this.state = {hasError: false}; |
| 150 | } |
| 151 | componentDidCatch() { |
| 152 | this.setState({hasError: true}); |
| 153 | // No need to detail this error because React print these information. |
| 154 | notify( |
| 155 | 'Plugin error', |
| 156 | `Plugins decorating ${name} has been disabled because of a plugin crash. Check Developer Tools for details.` |
| 157 | ); |
| 158 | } |
| 159 | render() { |
| 160 | const Sub = this.state.hasError ? Component_ : getDecorated(Component_, name); |
| 161 | return React.createElement(Sub, this.props); |