MCPcopy
hub / github.com/preactjs/preact / componentDidCatch

Method componentDidCatch

compat/test/browser/suspense.test.jsx:28–34  ·  view source on GitHub ↗
(e)

Source from the content-addressed store, hash-verified

26 }
27
28 componentDidCatch(e) {
29 if (e.then) {
30 this.setState({ error: { message: '{Promise}' } });
31 } else {
32 this.setState({ error: e });
33 }
34 }
35
36 render(props, state) {
37 return state.error ? (

Callers

nothing calls this directly

Calls 1

setStateMethod · 0.80

Tested by

no test coverage detected