MCPcopy
hub / github.com/bberak/react-native-game-engine / componentDidMount

Method componentDidMount

src/GameEngine.js:42–55  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

40 }
41
42 async componentDidMount() {
43 let entities = getEntitiesFromProps(this.props);
44
45 if (isPromise(entities)) entities = await entities;
46
47 this.setState(
48 {
49 entities: entities || {}
50 },
51 () => {
52 if (this.props.running) this.start();
53 }
54 );
55 }
56
57 componentWillUnmount() {
58 this.stop();

Callers

nothing calls this directly

Calls 3

getEntitiesFromPropsFunction · 0.85
isPromiseFunction · 0.85
startMethod · 0.80

Tested by

no test coverage detected