MCPcopy
hub / github.com/mobxjs/mobx / constructor

Method constructor

packages/mobx-react/__tests__/observer.test.tsx:1134–1144  ·  view source on GitHub ↗
(props)

Source from the content-addressed store, hash-verified

1132 }
1133
1134 constructor(props) {
1135 super(props)
1136 // Synchronize our observableProp with the actual prop on the first render.
1137 this.observableProp = this.props.prop
1138 makeObservable(this, {
1139 observableProp: observable,
1140 computed: computed,
1141 // Mutates observable therefore must be action
1142 componentDidUpdate: action
1143 })
1144 }
1145
1146 componentDidMount(): void {
1147 // Reactions/autoruns must be created in componenDidMount (not in constructor).

Callers

nothing calls this directly

Calls 1

makeObservableFunction · 0.90

Tested by

no test coverage detected