diff --git a/ReactCommon/fabric/core/shadownode/Props.cpp b/ReactCommon/fabric/core/shadownode/Props.cpp index d56726f7bd5..d3969cdcb80 100644 --- a/ReactCommon/fabric/core/shadownode/Props.cpp +++ b/ReactCommon/fabric/core/shadownode/Props.cpp @@ -14,7 +14,8 @@ namespace facebook { namespace react { Props::Props(const Props &sourceProps, const RawProps &rawProps) - : nativeId(convertRawProp(rawProps, "nativeID", sourceProps.nativeId)) + : nativeId(convertRawProp(rawProps, "nativeID", sourceProps.nativeId)), + revision(sourceProps.revision + 1) #ifdef ANDROID , rawProps((folly::dynamic)rawProps) diff --git a/ReactCommon/fabric/core/shadownode/Props.h b/ReactCommon/fabric/core/shadownode/Props.h index 840ef84ade9..56362dddf87 100644 --- a/ReactCommon/fabric/core/shadownode/Props.h +++ b/ReactCommon/fabric/core/shadownode/Props.h @@ -31,6 +31,15 @@ class Props : public virtual Sealable, public virtual DebugStringConvertible { const std::string nativeId; + /* + * Special value that represents generation number of `Props` object, which + * increases when the object was constructed with some source `Props` object. + * Default props objects (that was constructed using default constructor) have + * revision equals `0`. + * The value might be used for optimization purposes. + */ + const int revision{0}; + #ifdef ANDROID const folly::dynamic rawProps = folly::dynamic::object(); #endif