Match-id-a915f78dcc8ebc19fdc1e4577d27d7bd4cd75d4a

This commit is contained in:
* 2022-02-21 17:43:04 +08:00 committed by *
parent 6775fcd4a0
commit c6c4ec9caa
1 changed files with 8 additions and 4 deletions

View File

@ -118,16 +118,20 @@ export function callComponentWillUpdate(inst, newProps, newState, nextContext) {
}
export function callComponentWillReceiveProps(inst, newProps: object, newContext: object) {
const oldState = inst.state;
if (inst.componentWillReceiveProps) {
const oldState = inst.state;
inst.componentWillReceiveProps(newProps, newContext);
}
if (inst.UNSAFE_componentWillReceiveProps) {
inst.UNSAFE_componentWillReceiveProps(newProps, newContext);
}
if (inst.state !== oldState) {
changeStateContent.call(inst, UpdateState.Override, inst.state, null);
}
}
if (inst.UNSAFE_componentWillReceiveProps) {
const oldState = inst.state;
inst.UNSAFE_componentWillReceiveProps(newProps, newContext);
if (inst.state !== oldState) {
changeStateContent.call(inst, UpdateState.Override, inst.state, null);
}
}
}
export function markComponentDidMount(processing: VNode) {