Open rtrbt opened 10 months ago
class Catcher extends Component { state :{ error: Error } = {error: null}; componentDidCatch(error: Error) { this.setState({ error: error }); } render(props: {children: ComponentChildren}, state: { error: Error }) { if (state.error != null) { return <pre>{state.error.stack}</pre>; } return props.children; } }
example usage:
render(<Catcher><Mqtt/></Catcher>, $('#mqtt')[0])
Maybe wait until the site skeleton is ported over to preact to not modify every page render call twice.
Explain what happened and how to report bugs on the error page. Maybe mention the recovery page (at least if rendering the firmware update page fails)
example usage:
Maybe wait until the site skeleton is ported over to preact to not modify every page render call twice.
Explain what happened and how to report bugs on the error page. Maybe mention the recovery page (at least if rendering the firmware update page fails)