mirror of
https://github.com/facebook/react.git
synced 2025-11-01 09:12:30 +00:00
Use the canonical nativeTag for Fabric's setNativeProps (#14900)
* Use the canonical nativeTag for Fabric's setNativeProps * Fix prettier
This commit is contained in:
@@ -153,6 +153,8 @@ export default function(
|
||||
return;
|
||||
}
|
||||
|
||||
const nativeTag =
|
||||
maybeInstance._nativeTag || maybeInstance.canonical._nativeTag;
|
||||
const viewConfig: ReactNativeBaseComponentViewConfig<> =
|
||||
maybeInstance.viewConfig || maybeInstance.canonical.viewConfig;
|
||||
|
||||
@@ -163,7 +165,7 @@ export default function(
|
||||
// view invalidation for certain components (eg RCTTextInput) on iOS.
|
||||
if (updatePayload != null) {
|
||||
UIManager.updateView(
|
||||
maybeInstance._nativeTag,
|
||||
nativeTag,
|
||||
viewConfig.uiViewClassName,
|
||||
updatePayload,
|
||||
);
|
||||
|
||||
@@ -189,6 +189,11 @@ describe('ReactFabric', () => {
|
||||
|
||||
viewRef.setNativeProps({foo: 'baz'});
|
||||
expect(UIManager.updateView).toHaveBeenCalledTimes(1);
|
||||
expect(UIManager.updateView).toHaveBeenCalledWith(
|
||||
expect.any(Number),
|
||||
'RCTView',
|
||||
{foo: 'baz'},
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -120,6 +120,11 @@ describe('ReactNative', () => {
|
||||
|
||||
viewRef.setNativeProps({foo: 'baz'});
|
||||
expect(UIManager.updateView).toHaveBeenCalledTimes(1);
|
||||
expect(UIManager.updateView).toHaveBeenCalledWith(
|
||||
expect.any(Number),
|
||||
'RCTView',
|
||||
{foo: 'baz'},
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user