MCPcopy
hub / github.com/baidu/amis / componentDidUpdate

Method componentDidUpdate

packages/amis/src/renderers/Mapping.tsx:179–209  ·  view source on GitHub ↗
(prevProps: MappingProps)

Source from the content-addressed store, hash-verified

177 }
178
179 componentDidUpdate(prevProps: MappingProps) {
180 const props = this.props;
181 const {store, source, data} = this.props;
182 store.syncProps(
183 props,
184 prevProps,
185 source ? ['valueField'] : ['valueField', 'map']
186 );
187
188 if (isPureVariable(source)) {
189 const prev = resolveVariableAndFilter(
190 prevProps.source as string,
191 prevProps.data,
192 '| raw'
193 );
194 const curr = resolveVariableAndFilter(source as string, data, '| raw');
195
196 if (prev !== curr) {
197 store.setMap(curr);
198 }
199 } else if (
200 isApiOutdated(
201 prevProps.source,
202 props.source,
203 prevProps.data,
204 props.data
205 )
206 ) {
207 this.reload();
208 }
209 }
210
211 reload() {
212 const {source, data, env} = this.props;

Callers

nothing calls this directly

Calls 4

isPureVariableFunction · 0.90
resolveVariableAndFilterFunction · 0.90
isApiOutdatedFunction · 0.90
reloadMethod · 0.45

Tested by

no test coverage detected