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

Method componentDidUpdate

packages/amis/src/renderers/Wizard.tsx:331–356  ·  view source on GitHub ↗
(prevProps: WizardProps)

Source from the content-addressed store, hash-verified

329 }
330
331 componentDidUpdate(prevProps: WizardProps) {
332 const props = this.props;
333 const {store, fetchSuccess, fetchFailed} = props;
334
335 // 步骤steps、上下文数据data改变时需要执行normalizeSteps
336 if (
337 !isEqual(prevProps.steps, props.steps) ||
338 !isEqual(prevProps.data, props.data)
339 ) {
340 this.normalizeSteps(props.data);
341 }
342
343 if (
344 isApiOutdated(
345 prevProps.initApi,
346 props.initApi,
347 prevProps.data,
348 props.data
349 )
350 ) {
351 store.fetchData(props.initApi, store.data, {
352 successMessage: fetchSuccess,
353 errorMessage: fetchFailed
354 });
355 }
356 }
357
358 componentWillUnmount() {
359 this.asyncCancel && this.asyncCancel();

Callers

nothing calls this directly

Calls 2

normalizeStepsMethod · 0.95
isApiOutdatedFunction · 0.90

Tested by

no test coverage detected