Files
react-native/packages
Riccardo CipolleschiandBlake Friedman a1ac30193d Do not discard props when setNativeProps is used (#47669)
Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/47669

When investigating [#47476](https://github.com/facebook/react-native/issues/47476), I found that the `secureTextInput` prop was not changing in the Mounting layer when changing it in JS.

I track down the problem to the `UIManager::cloneNode` method.
When we clone the node, we first merge the patch that arrives from React into the props controlled by setNativeProps, ignoring the patch's props that are controlled by React.

But then, we forgot to merge back the React's controlled property into the final props, effectively losing them.

This change adds an extra merging step, merging the props controlled with setNativeProps back into the patch of props controlled by React, and then using this new set of props as source of truth.

## Changelog:
[General][Fixed] - do not discard props in the patch when they are not null while using `useNativeProps`

Reviewed By: sammy-SC

Differential Revision: D65948574

fbshipit-source-id: db4f2b793f4a6348456933c95a151012252b8ebc
2024-12-04 16:32:15 +00:00
..
2024-11-21 19:12:36 +00:00
2024-11-21 19:12:36 +00:00
2024-11-21 19:12:36 +00:00
2024-11-21 19:12:36 +00:00
2024-11-21 19:12:36 +00:00
2024-11-21 19:12:36 +00:00
2024-11-21 19:12:36 +00:00
2024-11-21 19:12:36 +00:00
2024-11-21 19:12:36 +00:00
2024-11-21 19:12:36 +00:00
2024-11-21 19:12:36 +00:00
2024-11-21 19:12:36 +00:00
2024-11-21 19:12:36 +00:00
2024-11-21 19:12:36 +00:00
2024-11-21 19:12:36 +00:00
2024-11-21 19:12:36 +00:00
2024-11-21 19:12:36 +00:00
2024-11-21 19:12:36 +00:00
2024-11-21 19:12:36 +00:00
2024-11-21 19:12:36 +00:00
2024-11-21 23:09:09 +00:00
2024-11-21 19:12:36 +00:00
2024-11-21 19:12:36 +00:00