make instance variables const in RCTComponentViewDescriptor (#52902)

Summary:
Pull Request resolved: https://github.com/facebook/react-native/pull/52902

changelog: [internal]

These values must not change during view's life cycle.

Reviewed By: rshest

Differential Revision: D79165823

fbshipit-source-id: dff85d369e4f79ba88740b0f3a23b71af5ec0c5e
This commit is contained in:
Samuel Susla
2025-07-29 09:19:16 -07:00
committed by Facebook GitHub Bot
parent 04ae15d99b
commit 4b07edd6ea
@@ -21,15 +21,15 @@ class RCTComponentViewDescriptor final {
/*
* Associated (and owned) native view instance.
*/
__strong UIView<RCTComponentViewProtocol> *view = nil;
__strong UIView<RCTComponentViewProtocol> *const view = nil;
/*
* Indicates a requirement to call on the view methods from
* `RCTMountingTransactionObserving` protocol.
*/
bool observesMountingTransactionWillMount{false};
bool observesMountingTransactionDidMount{false};
bool shouldBeRecycled{true};
const bool observesMountingTransactionWillMount{false};
const bool observesMountingTransactionDidMount{false};
const bool shouldBeRecycled{true};
};
inline bool operator==(const RCTComponentViewDescriptor &lhs, const RCTComponentViewDescriptor &rhs)