mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
Fabric: Props now have a revision number
Summary: Props now have a special value that represents generation number of `Props` object, which increases when the object was constructed with some source `Props` object. Reviewed By: mdvacca Differential Revision: D14293939 fbshipit-source-id: 4782bf33ccf37623d4079c09cc4d0268bb6c2690
This commit is contained in:
committed by
Facebook Github Bot
parent
ada9dbf919
commit
6bc7ef0b19
@@ -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)
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user