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

Method constructor

test-utils/test/shared/rerender.test.jsx:27–32  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

25 let increment;
26 class Counter extends Component {
27 constructor(props) {
28 super(props);
29
30 this.state = { count: 0 };
31 increment = () => this.setState({ count: this.state.count + 1 });
32 }
33
34 render() {
35 return <div>{this.state.count}</div>;

Callers

nothing calls this directly

Calls 1

setStateMethod · 0.80

Tested by

no test coverage detected