mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/52243 Building on the availability of `toDynamic` conversion methods for all supported property types, this diff adds support for diffing of `ObjectType` props. The template adds the generation of a default comparator for the generated C++ struct. The struct also gains a `toDynamic` conversion method that will convert each property of the object type to a `folly::dynamic` value. Primitive types make use of the implicit conversion supported by `folly::dynamic`, all other types are converted using `toDynamic`. The `toDynamic` logic is implemented as a method defined on the struct to avoid increased binary size when required multiple times by the prop diffing implementation. The external `toDynamic` conversion function calls the struct method directly. This enables support for converting object types using object types within their props. Changelog: [Internal] Reviewed By: mdvacca Differential Revision: D77234064 fbshipit-source-id: 21deb3104303aa374fb65b969af57a6aca6db38c