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

Method constructor

compat/test/browser/suspense-utils.js:92–97  ·  view source on GitHub ↗
(props, context)

Source from the content-addressed store, hash-verified

90 let renderLazy;
91 class Suspender extends Component {
92 constructor(props, context) {
93 super(props, context);
94 this.state = { Lazy: null };
95
96 renderLazy = Lazy => this.setState({ Lazy });
97 }
98
99 render(props, state) {
100 return state.Lazy ? h(state.Lazy, props) : h(DefaultComponent, props);

Callers

nothing calls this directly

Calls 1

setStateMethod · 0.80

Tested by

no test coverage detected