mirror of
https://github.com/react/react-native.git
synced 2026-09-28 13:23:09 +08:00
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/54391 Changelog: [Internal][Fixed] Default init custom C++ TM struct properties Right now we don't do it and produce code as: ``` template <typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6> struct NativeEditableObjectModulePropertyVal { P0 classOrList; P1 commonFields; P2 desc; P3 isDefault; P4 isSet; P5 scriptValue; P6 value; bool operator==(const NativeEditableObjectModulePropertyVal &other) const { return classOrList == other.classOrList && commonFields == other.commonFields && desc == other.desc && isDefault == other.isDefault && isSet == other.isSet && scriptValue == other.scriptValue && value == other.value; } }; ``` Now we do: ``` template <typename P0, typename P1, typename P2, typename P3, typename P4, typename P5, typename P6> struct NativeEditableObjectModulePropertyVal { P0 classOrList{}; P1 commonFields{}; P2 desc{}; P3 isDefault{}; P4 isSet{}; P5 scriptValue{}; P6 value{}; bool operator==(const NativeEditableObjectModulePropertyVal &other) const { return classOrList == other.classOrList && commonFields == other.commonFields && desc == other.desc && isDefault == other.isDefault && isSet == other.isSet && scriptValue == other.scriptValue && value == other.value; } }; ``` Reviewed By: sbuggay, lenaic Differential Revision: D86142954 fbshipit-source-id: 989e81c55b1fad7e1e58ea89461f064772143c9d