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

Method componentDidCatch

compat/test/browser/componentDidCatch.test.jsx:25–28  ·  view source on GitHub ↗
(error, errorInfo)

Source from the content-addressed store, hash-verified

23 update = this.setState.bind(this);
24 }
25 componentDidCatch(error, errorInfo) {
26 info = errorInfo;
27 this.setState({ error });
28 }
29 render() {
30 if (this.state.error) return <div />;
31 // @ts-expect-error

Callers

nothing calls this directly

Calls 1

setStateMethod · 0.80

Tested by

no test coverage detected