Match-id-97c0af573376bf091e9db7228d7cea81484ba94a
This commit is contained in:
parent
46c4e406b1
commit
b7183f1082
|
@ -103,7 +103,15 @@ function markLifeCycle(processing: VNode, nextProps: object, shouldUpdate: Boole
|
||||||
}
|
}
|
||||||
|
|
||||||
// 用于类组件
|
// 用于类组件
|
||||||
export function captureClassComponent(processing: VNode, clazz: any, nextProps: object): VNode | null {
|
export function captureRender(processing: VNode): VNode | null {
|
||||||
|
let clazz = processing.type;
|
||||||
|
let nextProps = processing.props;
|
||||||
|
if (processing.isLazyComponent) {
|
||||||
|
nextProps = mergeDefaultProps(clazz, nextProps);
|
||||||
|
if (processing.promiseResolve) { // 该函数被 lazy 组件使用,未加载的组件需要加载组件的真实内容
|
||||||
|
clazz = clazz._load(clazz._content);
|
||||||
|
}
|
||||||
|
}
|
||||||
const isOldCxtExist = isOldProvider(clazz);
|
const isOldCxtExist = isOldProvider(clazz);
|
||||||
cacheOldCtx(processing, isOldCxtExist);
|
cacheOldCtx(processing, isOldCxtExist);
|
||||||
|
|
||||||
|
@ -175,13 +183,6 @@ export function captureClassComponent(processing: VNode, clazz: any, nextProps:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export function captureRender(processing: VNode): VNode | null {
|
|
||||||
const clazz = processing.type;
|
|
||||||
const props = processing.props;
|
|
||||||
const nextProps = processing.isLazyComponent ? mergeDefaultProps(clazz, props) : props;
|
|
||||||
return captureClassComponent(processing, clazz, nextProps);
|
|
||||||
}
|
|
||||||
|
|
||||||
export function bubbleRender(processing: VNode) {
|
export function bubbleRender(processing: VNode) {
|
||||||
if (isOldProvider(processing.type)) {
|
if (isOldProvider(processing.type)) {
|
||||||
resetOldCtx(processing);
|
resetOldCtx(processing);
|
||||||
|
|
|
@ -10,7 +10,7 @@ import {
|
||||||
} from '../vnode/VNodeTags';
|
} from '../vnode/VNodeTags';
|
||||||
import { throwIfTrue } from '../utils/throwIfTrue';
|
import { throwIfTrue } from '../utils/throwIfTrue';
|
||||||
import { captureFunctionComponent } from './FunctionComponent';
|
import { captureFunctionComponent } from './FunctionComponent';
|
||||||
import { captureClassComponent } from './ClassComponent';
|
import { captureRender as captureClassComponent } from './ClassComponent';
|
||||||
import { captureMemoComponent } from './MemoComponent';
|
import { captureMemoComponent } from './MemoComponent';
|
||||||
|
|
||||||
export function bubbleRender() { }
|
export function bubbleRender() { }
|
||||||
|
|
Loading…
Reference in New Issue