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

Method constructor

compat/test/browser/suspense.test.jsx:499–504  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

497
498 class LifecycleSuspender extends Component {
499 constructor(props) {
500 super(props);
501 this.state = { count: 0 };
502
503 increment = () => this.setState(({ count }) => ({ count: count + 1 }));
504 }
505 render() {
506 if (this.state.count == 2 && !resolved) {
507 throw promise;

Callers

nothing calls this directly

Calls 1

setStateMethod · 0.80

Tested by

no test coverage detected