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 3b271de89b
commit 5a55718124
6 changed files with 2 additions and 29 deletions
+1 -7
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);
}
@@ -702,7 +702,6 @@ export function commitMount(
export function commitUpdate(
domElement: Instance,
updatePayload: any,
type: string,
oldProps: Props,
newProps: Props,
@@ -348,7 +348,6 @@ export function commitMount(
export function commitUpdate(
instance: Instance,
updatePayloadTODO: Object,
type: string,
oldProps: Props,
newProps: Props,
-1
View File
@@ -651,7 +651,6 @@ function createReactNoop(reconciler: Function, useMutation: boolean) {
commitUpdate(
instance: Instance,
updatePayload: Object,
type: string,
oldProps: Props,
newProps: Props,
+1 -18
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);
}
@@ -237,7 +237,6 @@ export const supportsMutation = true;
export function commitUpdate(
instance: Instance,
updatePayload: null | {...},
type: string,
oldProps: Props,
newProps: Props,