From 4b07edd6ea7e6fbf446db36e39b4229cef82e159 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Tue, 29 Jul 2025 09:19:16 -0700 Subject: [PATCH] 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 --- .../React/Fabric/Mounting/RCTComponentViewDescriptor.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/react-native/React/Fabric/Mounting/RCTComponentViewDescriptor.h b/packages/react-native/React/Fabric/Mounting/RCTComponentViewDescriptor.h index fd1c4b9feb0..c0ecced2296 100644 --- a/packages/react-native/React/Fabric/Mounting/RCTComponentViewDescriptor.h +++ b/packages/react-native/React/Fabric/Mounting/RCTComponentViewDescriptor.h @@ -21,15 +21,15 @@ class RCTComponentViewDescriptor final { /* * Associated (and owned) native view instance. */ - __strong UIView *view = nil; + __strong UIView *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)