Reconciler: Change commitUpdate signature to account for unused updatePayload parameter (#28909)

This commit is contained in:
Sebastian Silbermann 2024-04-25 19:14:06 +02:00 committed by GitHub
parent d285b3acba
commit 82d8129e58
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 2 additions and 29 deletions

View File

@ -415,13 +415,7 @@ export function commitMount(instance, type, newProps) {
// Noop
}
export function commitUpdate(
instance,
updatePayload,
type,
oldProps,
newProps,
) {
export function commitUpdate(instance, type, oldProps, newProps) {
instance._applyProps(instance, newProps, oldProps);
}

View File

@ -702,7 +702,6 @@ export function commitMount(
export function commitUpdate(
domElement: Instance,
updatePayload: any,
type: string,
oldProps: Props,
newProps: Props,

View File

@ -348,7 +348,6 @@ export function commitMount(
export function commitUpdate(
instance: Instance,
updatePayloadTODO: Object,
type: string,
oldProps: Props,
newProps: Props,

View File

@ -651,7 +651,6 @@ function createReactNoop(reconciler: Function, useMutation: boolean) {
commitUpdate(
instance: Instance,
updatePayload: Object,
type: string,
oldProps: Props,
newProps: Props,

View File

@ -13,7 +13,6 @@ import type {
SuspenseInstance,
Container,
ChildSet,
UpdatePayload,
HoistableRoot,
FormInstance,
} from './ReactFiberConfig';
@ -2676,14 +2675,9 @@ function commitMutationEffectsOnFiber(
);
}
} else if (newResource === null && finishedWork.stateNode !== null) {
// We may have an update on a Hoistable element
const updatePayload: null | UpdatePayload =
(finishedWork.updateQueue: any);
finishedWork.updateQueue = null;
try {
commitUpdate(
finishedWork.stateNode,
updatePayload,
finishedWork.type,
current.memoizedProps,
finishedWork.memoizedProps,
@ -2754,19 +2748,8 @@ function commitMutationEffectsOnFiber(
const oldProps =
current !== null ? current.memoizedProps : newProps;
const type = finishedWork.type;
// TODO: Type the updateQueue to be specific to host components.
const updatePayload: null | UpdatePayload =
(finishedWork.updateQueue: any);
finishedWork.updateQueue = null;
try {
commitUpdate(
instance,
updatePayload,
type,
oldProps,
newProps,
finishedWork,
);
commitUpdate(instance, type, oldProps, newProps, finishedWork);
} catch (error) {
captureCommitPhaseError(finishedWork, finishedWork.return, error);
}

View File

@ -237,7 +237,6 @@ export const supportsMutation = true;
export function commitUpdate(
instance: Instance,
updatePayload: null | {...},
type: string,
oldProps: Props,
newProps: Props,