Skip to content

[react-native] Consume ReactNativeAttributePayloadFabric from ReactNativePrivateInterface #33616

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 25, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions packages/react-native-renderer/src/ReactFiberConfigFabric.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import type {
TouchedViewDataAtPoint,
ViewConfig,
} from './ReactNativeTypes';
import {create, diff} from './ReactNativeAttributePayloadFabric';
import {dispatchEvent} from './ReactFabricEventEmitter';
import {
NoEventPriority,
Expand All @@ -35,6 +34,8 @@ import {
deepFreezeAndThrowOnMutationInDev,
createPublicInstance,
createPublicTextInstance,
createAttributePayload,
diffAttributePayloads,
type PublicInstance as ReactNativePublicInstance,
type PublicTextInstance,
type PublicRootInstance,
Expand Down Expand Up @@ -190,7 +191,10 @@ export function createInstance(
}
}

const updatePayload = create(props, viewConfig.validAttributes);
const updatePayload = createAttributePayload(
props,
viewConfig.validAttributes,
);

const node = createNode(
tag, // reactTag
Expand Down Expand Up @@ -456,7 +460,11 @@ export function cloneInstance(
newChildSet: ?ChildSet,
): Instance {
const viewConfig = instance.canonical.viewConfig;
const updatePayload = diff(oldProps, newProps, viewConfig.validAttributes);
const updatePayload = diffAttributePayloads(
oldProps,
newProps,
viewConfig.validAttributes,
);
// TODO: If the event handlers have changed, we need to update the current props
// in the commit phase but there is no host config hook to do it yet.
// So instead we hack it by updating it in the render phase.
Expand Down Expand Up @@ -505,7 +513,7 @@ export function cloneHiddenInstance(
): Instance {
const viewConfig = instance.canonical.viewConfig;
const node = instance.node;
const updatePayload = create(
const updatePayload = createAttributePayload(
{style: {display: 'none'}},
viewConfig.validAttributes,
);
Expand Down
Loading
Loading