(prevProps: WizardProps)
| 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(); |
nothing calls this directly
no test coverage detected