Skip to content

Commit d1e8328

Browse files
NickGerlemanfacebook-github-bot
authored andcommitted
Add QualifierAlignment to Clang Format Config (#44098)
Summary: Pull Request resolved: #44098 This sets `QualiferAlignment` so that code is automatically formatted to west const. I did a pass at this before, but now that we are on new Clang Format, we can enforce it automatically, and I think a couple more cases not previously changed now are. Changelog: [Internal] Reviewed By: christophpurrer Differential Revision: D56143678 fbshipit-source-id: 8f12b288476ea6019fd7d7a93a39b4fe2e75af14
1 parent d53a2bd commit d1e8328

File tree

55 files changed

+100
-99
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+100
-99
lines changed

.clang-format

+1
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ SpacesInSquareBrackets: false
8484
Standard: Cpp11
8585
TabWidth: 8
8686
UseTab: Never
87+
QualifierAlignment: Left
8788
---
8889
Language: ObjC
8990
ColumnLimit: 120

packages/react-native/Libraries/AppDelegate/RCTRootViewFactory.mm

+2-2
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,8 @@ - (instancetype)initWithConfiguration:(RCTRootViewFactoryConfiguration *)configu
105105
{
106106
if (self = [super init]) {
107107
_configuration = configuration;
108-
_contextContainer = std::make_shared<facebook::react::ContextContainer const>();
109-
_reactNativeConfig = std::make_shared<facebook::react::EmptyReactNativeConfig const>();
108+
_contextContainer = std::make_shared<const facebook::react::ContextContainer>();
109+
_reactNativeConfig = std::make_shared<const facebook::react::EmptyReactNativeConfig>();
110110
_contextContainer->insert("ReactNativeConfig", _reactNativeConfig);
111111
_turboModuleManagerDelegate = turboModuleManagerDelegate;
112112
}

packages/react-native/React/Fabric/Mounting/ComponentViews/Image/RCTImageComponentView.mm

+3-3
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,11 @@ - (void)updateState:(const State::Shared &)state oldState:(const State::Shared &
7474
{
7575
RCTAssert(state, @"`state` must not be null.");
7676
RCTAssert(
77-
std::dynamic_pointer_cast<ImageShadowNode::ConcreteState const>(state),
77+
std::dynamic_pointer_cast<const ImageShadowNode::ConcreteState>(state),
7878
@"`state` must be a pointer to `ImageShadowNode::ConcreteState`.");
7979

80-
auto oldImageState = std::static_pointer_cast<ImageShadowNode::ConcreteState const>(_state);
81-
auto newImageState = std::static_pointer_cast<ImageShadowNode::ConcreteState const>(state);
80+
auto oldImageState = std::static_pointer_cast<const ImageShadowNode::ConcreteState>(_state);
81+
auto newImageState = std::static_pointer_cast<const ImageShadowNode::ConcreteState>(state);
8282

8383
[self _setStateAndResubscribeImageResponseObserver:newImageState];
8484

packages/react-native/React/Fabric/Mounting/ComponentViews/InputAccessory/RCTInputAccessoryComponentView.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &
120120
- (void)updateState:(const facebook::react::State::Shared &)state
121121
oldState:(const facebook::react::State::Shared &)oldState
122122
{
123-
_state = std::static_pointer_cast<InputAccessoryShadowNode::ConcreteState const>(state);
123+
_state = std::static_pointer_cast<const InputAccessoryShadowNode::ConcreteState>(state);
124124
CGSize oldScreenSize = RCTCGSizeFromSize(_state->getData().viewportSize);
125125
CGSize viewportSize = RCTViewportSize();
126126
viewportSize.height = std::nan("");

packages/react-native/React/Fabric/Mounting/ComponentViews/LegacyViewManagerInterop/RCTLegacyViewManagerInteropComponentView.mm

+2-2
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ + (ComponentDescriptorProvider)componentDescriptorProvider
193193

194194
- (void)updateState:(const State::Shared &)state oldState:(const State::Shared &)oldState
195195
{
196-
_state = std::static_pointer_cast<LegacyViewManagerInteropShadowNode::ConcreteState const>(state);
196+
_state = std::static_pointer_cast<const LegacyViewManagerInteropShadowNode::ConcreteState>(state);
197197
}
198198

199199
- (void)finalizeUpdates:(RNComponentViewUpdateMask)updateMask
@@ -217,7 +217,7 @@ - (void)finalizeUpdates:(RNComponentViewUpdateMask)updateMask
217217
if (weakSelf) {
218218
__typeof(self) strongSelf = weakSelf;
219219
const auto &eventEmitter =
220-
static_cast<LegacyViewManagerInteropViewEventEmitter const &>(*strongSelf->_eventEmitter);
220+
static_cast<const LegacyViewManagerInteropViewEventEmitter &>(*strongSelf->_eventEmitter);
221221
eventEmitter.dispatchEvent(eventName, event);
222222
}
223223
};

packages/react-native/React/Fabric/Mounting/ComponentViews/SafeAreaView/RCTSafeAreaViewComponentView.mm

+2-2
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ - (void)_updateStateIfNecessary
6363

6464
auto newData = oldData;
6565
newData.padding = newPadding;
66-
return std::make_shared<SafeAreaViewShadowNode::ConcreteState::Data const>(newData);
66+
return std::make_shared<const SafeAreaViewShadowNode::ConcreteState::Data>(newData);
6767
});
6868
}
6969

@@ -77,7 +77,7 @@ + (ComponentDescriptorProvider)componentDescriptorProvider
7777
- (void)updateState:(const facebook::react::State::Shared &)state
7878
oldState:(const facebook::react::State::Shared &)oldState
7979
{
80-
_state = std::static_pointer_cast<SafeAreaViewShadowNode::ConcreteState const>(state);
80+
_state = std::static_pointer_cast<const SafeAreaViewShadowNode::ConcreteState>(state);
8181
}
8282

8383
- (void)finalizeUpdates:(RNComponentViewUpdateMask)updateMask

packages/react-native/React/Fabric/Mounting/ComponentViews/ScrollView/RCTScrollViewComponentView.mm

+3-3
Original file line numberDiff line numberDiff line change
@@ -308,8 +308,8 @@ - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &
308308

309309
- (void)updateState:(const State::Shared &)state oldState:(const State::Shared &)oldState
310310
{
311-
assert(std::dynamic_pointer_cast<ScrollViewShadowNode::ConcreteState const>(state));
312-
_state = std::static_pointer_cast<ScrollViewShadowNode::ConcreteState const>(state);
311+
assert(std::dynamic_pointer_cast<const ScrollViewShadowNode::ConcreteState>(state));
312+
_state = std::static_pointer_cast<const ScrollViewShadowNode::ConcreteState>(state);
313313
auto &data = _state->getData();
314314

315315
auto contentOffset = RCTCGPointFromPoint(data.contentOffset);
@@ -412,7 +412,7 @@ - (void)_updateStateWithContentOffset
412412
_state->updateState([contentOffset](const ScrollViewShadowNode::ConcreteState::Data &data) {
413413
auto newData = data;
414414
newData.contentOffset = contentOffset;
415-
return std::make_shared<ScrollViewShadowNode::ConcreteState::Data const>(newData);
415+
return std::make_shared<const ScrollViewShadowNode::ConcreteState::Data>(newData);
416416
});
417417
}
418418

packages/react-native/React/Fabric/Mounting/ComponentViews/Text/RCTParagraphComponentView.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &
105105

106106
- (void)updateState:(const State::Shared &)state oldState:(const State::Shared &)oldState
107107
{
108-
_state = std::static_pointer_cast<ParagraphShadowNode::ConcreteState const>(state);
108+
_state = std::static_pointer_cast<const ParagraphShadowNode::ConcreteState>(state);
109109
[self setNeedsDisplay];
110110
}
111111

packages/react-native/React/Fabric/Mounting/ComponentViews/TextInput/RCTTextInputComponentView.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &
216216

217217
- (void)updateState:(const State::Shared &)state oldState:(const State::Shared &)oldState
218218
{
219-
_state = std::static_pointer_cast<TextInputShadowNode::ConcreteState const>(state);
219+
_state = std::static_pointer_cast<const TextInputShadowNode::ConcreteState>(state);
220220

221221
if (!_state) {
222222
assert(false && "State is `null` for <TextInput> component.");

packages/react-native/React/Fabric/Mounting/ComponentViews/View/RCTViewComponentView.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ - (void)updateProps:(const Props::Shared &)props oldProps:(const Props::Shared &
195195
RCTAssert(
196196
propsRawPtr &&
197197
([self class] == [RCTViewComponentView class] ||
198-
typeid(*propsRawPtr).hash_code() != typeid(ViewProps const).hash_code()),
198+
typeid(*propsRawPtr).hash_code() != typeid(const ViewProps).hash_code()),
199199
@"`RCTViewComponentView` subclasses (and `%@` particularly) must setup `_props`"
200200
" instance variable with a default value in the constructor.",
201201
NSStringFromClass([self class]));

packages/react-native/React/Fabric/Mounting/RCTComponentViewFactory.mm

+2-2
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ - (BOOL)registerComponentIfPossible:(const std::string &)name
145145
@"Legacy ViewManagers should be migrated to Fabric ComponentViews in the new architecture to reduce risk. Component using interop layer: %@",
146146
componentNameString]);
147147

148-
auto flavor = std::make_shared<std::string const>(name);
148+
auto flavor = std::make_shared<const std::string>(name);
149149
auto componentName = ComponentName{flavor->c_str()};
150150
auto componentHandle = reinterpret_cast<ComponentHandle>(componentName);
151151
auto constructor = [RCTLegacyViewManagerInteropComponentView componentDescriptorProvider].constructor;
@@ -159,7 +159,7 @@ - (BOOL)registerComponentIfPossible:(const std::string &)name
159159
}
160160

161161
// Fallback 4: use <UnimplementedView> if component doesn't exist.
162-
auto flavor = std::make_shared<std::string const>(name);
162+
auto flavor = std::make_shared<const std::string>(name);
163163
auto componentName = ComponentName{flavor->c_str()};
164164
auto componentHandle = reinterpret_cast<ComponentHandle>(componentName);
165165
auto constructor = [RCTUnimplementedViewComponentView componentDescriptorProvider].constructor;

packages/react-native/React/Fabric/RCTSurfacePresenter.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -295,7 +295,7 @@ - (RCTScheduler *)_createScheduler
295295
toolbox.asynchronousEventBeatFactory =
296296
[runtimeExecutor](const EventBeat::SharedOwnerBox &ownerBox) -> std::unique_ptr<EventBeat> {
297297
auto runLoopObserver =
298-
std::make_unique<MainRunLoopObserver const>(RunLoopObserver::Activity::BeforeWaiting, ownerBox->owner);
298+
std::make_unique<const MainRunLoopObserver>(RunLoopObserver::Activity::BeforeWaiting, ownerBox->owner);
299299
return std::make_unique<AsynchronousEventBeat>(std::move(runLoopObserver), runtimeExecutor);
300300
};
301301

packages/react-native/React/Tests/Text/RCTParagraphComponentViewTests.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -316,7 +316,7 @@ - (void)setUp
316316
std::shared_ptr<ParagraphShadowNode> paragraphShadowNode)
317317
{
318318
auto sharedState =
319-
std::static_pointer_cast<ParagraphShadowNode::ConcreteState const>(paragraphShadowNode->getState());
319+
std::static_pointer_cast<const ParagraphShadowNode::ConcreteState>(paragraphShadowNode->getState());
320320
return sharedState;
321321
}
322322

packages/react-native/ReactCommon/cxxreact/MoveWrapper.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ class MoveWrapper {
107107

108108
// If you want these you're probably doing it wrong, though they'd be
109109
// easy enough to implement
110-
MoveWrapper& operator=(MoveWrapper const&) = delete;
110+
MoveWrapper& operator=(const MoveWrapper&) = delete;
111111
MoveWrapper& operator=(MoveWrapper&&) = delete;
112112

113113
private:

packages/react-native/ReactCommon/cxxreact/SystraceSection.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ struct DummySystraceSection {
5050
public:
5151
template <typename... ConvertsToStringPiece>
5252
explicit DummySystraceSection(
53-
__unused const char* name,
53+
const __unused char* name,
5454
__unused ConvertsToStringPiece&&... args) {}
5555
};
5656
using SystraceSection = DummySystraceSection;

packages/react-native/ReactCommon/jsinspector-modern/tests/FollyDynamicMatchers.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ std::string as_string(folly::dynamic value) {
2222
}
2323

2424
std::string explain_error(
25-
folly::dynamic::json_pointer_resolution_error<folly::dynamic const> error) {
25+
folly::dynamic::json_pointer_resolution_error<const folly::dynamic> error) {
2626
using err_code = folly::dynamic::json_pointer_resolution_error_code;
2727

2828
switch (error.error_code) {

packages/react-native/ReactCommon/jsinspector-modern/tests/FollyDynamicMatchers.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace folly_dynamic_matchers_utils {
1919
std::string as_string(std::string value);
2020
std::string as_string(folly::dynamic value);
2121
std::string explain_error(
22-
folly::dynamic::json_pointer_resolution_error<folly::dynamic const> error);
22+
folly::dynamic::json_pointer_resolution_error<const folly::dynamic> error);
2323

2424
} // namespace folly_dynamic_matchers_utils
2525

packages/react-native/ReactCommon/react/renderer/componentregistry/ComponentDescriptorProviderRegistry.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ class ComponentDescriptorProviderRegistry final {
6161
mutable std::shared_mutex mutex_;
6262
mutable std::vector<std::weak_ptr<const ComponentDescriptorRegistry>>
6363
componentDescriptorRegistries_;
64-
mutable std::unordered_map<ComponentHandle, ComponentDescriptorProvider const>
64+
mutable std::unordered_map<ComponentHandle, const ComponentDescriptorProvider>
6565
componentDescriptorProviders_;
6666
mutable ComponentDescriptorProviderRequest
6767
componentDescriptorProviderRequest_{};

packages/react-native/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropComponentDescriptor.mm

+1-1
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ static Class getViewManagerClass(const std::string &componentName, RCTBridge *br
109109
bridgeProxy = unwrapManagedObjectWeakly(optionalBridgeProxy.value());
110110
}
111111

112-
auto componentName = *std::static_pointer_cast<std::string const>(flavor);
112+
auto componentName = *std::static_pointer_cast<const std::string>(flavor);
113113
Class viewManagerClass = getViewManagerClass(componentName, bridge, bridgeProxy);
114114
assert(viewManagerClass);
115115

packages/react-native/ReactCommon/react/renderer/components/legacyviewmanagerinterop/LegacyViewManagerInteropViewProps.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class LegacyViewManagerInteropViewProps final : public ViewProps {
2222

2323
#pragma mark - Props
2424

25-
folly::dynamic const otherProps;
25+
const folly::dynamic otherProps;
2626
};
2727

2828
} // namespace facebook::react

packages/react-native/ReactCommon/react/renderer/components/text/ParagraphShadowNode.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ class ParagraphShadowNode final : public ConcreteViewShadowNode<
9797
*/
9898
void updateStateIfNeeded(const Content& content);
9999

100-
std::shared_ptr<TextLayoutManager const> textLayoutManager_;
100+
std::shared_ptr<const TextLayoutManager> textLayoutManager_;
101101

102102
/*
103103
* Cached content of the subtree started from the node.

packages/react-native/ReactCommon/react/renderer/components/text/ParagraphState.h

+4-4
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ class ParagraphState final {
5252
* This is not on every platform. This is not used on Android, but is
5353
* used on the iOS mounting layer.
5454
*/
55-
std::weak_ptr<TextLayoutManager const> layoutManager;
55+
std::weak_ptr<const TextLayoutManager> layoutManager;
5656

5757
#ifdef ANDROID
5858
ParagraphState(
59-
AttributedString const& attributedString,
60-
ParagraphAttributes const& paragraphAttributes,
61-
std::weak_ptr<const TextLayoutManager> const& layoutManager)
59+
const AttributedString& attributedString,
60+
const ParagraphAttributes& paragraphAttributes,
61+
const std::weak_ptr<const TextLayoutManager>& layoutManager)
6262
: attributedString(attributedString),
6363
paragraphAttributes(paragraphAttributes),
6464
layoutManager(layoutManager) {}

packages/react-native/ReactCommon/react/renderer/components/textinput/platform/ios/react/renderer/components/iostextinput/TextInputProps.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class TextInputProps final : public BaseTextInputProps {
3636
*/
3737
std::optional<Selection> selection{};
3838

39-
std::string const inputAccessoryViewID{};
39+
const std::string inputAccessoryViewID{};
4040

4141
bool onKeyPressSync{false};
4242
bool onChangeSync{false};

packages/react-native/ReactCommon/react/renderer/components/view/BaseViewProps.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ BorderMetrics BaseViewProps::resolveBorderMetrics(
398398
}
399399

400400
Transform BaseViewProps::resolveTransform(
401-
LayoutMetrics const& layoutMetrics) const {
401+
const LayoutMetrics& layoutMetrics) const {
402402
float viewWidth = layoutMetrics.frame.size.width;
403403
float viewHeight = layoutMetrics.frame.size.height;
404404
if (!transformOrigin.isSet() || (viewWidth == 0 && viewHeight == 0)) {

packages/react-native/ReactCommon/react/renderer/components/view/tests/ViewTest.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ TEST_F(YogaDirtyFlagTest, removingLastChildMustDirtyYogaNode) {
174174

175175
return oldShadowNode.clone(
176176
{ShadowNodeFragment::propsPlaceholder(),
177-
std::make_shared<ShadowNode::ListOfShared const>(children)});
177+
std::make_shared<const ShadowNode::ListOfShared>(children)});
178178
});
179179

180180
EXPECT_TRUE(
@@ -193,7 +193,7 @@ TEST_F(YogaDirtyFlagTest, reversingListOfChildrenMustDirtyYogaNode) {
193193

194194
return oldShadowNode.clone(
195195
{ShadowNodeFragment::propsPlaceholder(),
196-
std::make_shared<ShadowNode::ListOfShared const>(children)});
196+
std::make_shared<const ShadowNode::ListOfShared>(children)});
197197
});
198198

199199
EXPECT_TRUE(

packages/react-native/ReactCommon/react/renderer/core/ConcreteState.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ class ConcreteState : public State {
6060
*/
6161
void updateState(Data&& newData) const {
6262
updateState([data{std::move(newData)}](const Data& oldData) -> SharedData {
63-
return std::make_shared<Data const>(data);
63+
return std::make_shared<const Data>(data);
6464
});
6565
}
6666

@@ -85,7 +85,7 @@ class ConcreteState : public State {
8585
auto stateUpdate = StateUpdate{
8686
family, [=](const StateData::Shared& oldData) -> StateData::Shared {
8787
react_native_assert(oldData);
88-
return callback(*static_cast<Data const*>(oldData.get()));
88+
return callback(*static_cast<const Data*>(oldData.get()));
8989
}};
9090

9191
family->dispatchRawState(std::move(stateUpdate));

packages/react-native/ReactCommon/react/renderer/core/LayoutableShadowNode.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ template <class T>
2020
using LayoutableSmallVector = std::vector<T>;
2121

2222
static LayoutableSmallVector<Rect> calculateTransformedFrames(
23-
const LayoutableSmallVector<ShadowNode const*>& shadowNodeList,
23+
const LayoutableSmallVector<const ShadowNode*>& shadowNodeList,
2424
LayoutableShadowNode::LayoutInspectingPolicy policy) {
2525
auto size = shadowNodeList.size();
2626
auto transformedFrames = LayoutableSmallVector<Rect>{size};

packages/react-native/ReactCommon/react/renderer/core/RawProps.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ const RawValue* RawProps::at(
211211

212212
void RawProps::iterateOverValues(
213213
const std::function<
214-
void(RawPropsPropNameHash, const char*, RawValue const&)>& fn) const {
214+
void(RawPropsPropNameHash, const char*, const RawValue&)>& fn) const {
215215
return parser_->iterateOverValues(*this, fn);
216216
}
217217

packages/react-native/ReactCommon/react/renderer/core/RawProps.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class RawProps final {
101101
*/
102102
void iterateOverValues(
103103
const std::function<
104-
void(RawPropsPropNameHash, const char*, RawValue const&)>& fn) const;
104+
void(RawPropsPropNameHash, const char*, const RawValue&)>& fn) const;
105105

106106
private:
107107
friend class RawPropsParser;

packages/react-native/ReactCommon/react/renderer/core/RawPropsParser.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ void RawPropsParser::preparse(const RawProps& rawProps) const noexcept {
174174
void RawPropsParser::iterateOverValues(
175175
const RawProps& rawProps,
176176
const std::function<
177-
void(RawPropsPropNameHash, const char*, RawValue const&)>& visit)
177+
void(RawPropsPropNameHash, const char*, const RawValue&)>& visit)
178178
const {
179179
switch (rawProps.mode_) {
180180
case RawProps::Mode::Empty:

packages/react-native/ReactCommon/react/renderer/core/RawPropsParser.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class RawPropsParser final {
7979
void iterateOverValues(
8080
const RawProps& rawProps,
8181
const std::function<
82-
void(RawPropsPropNameHash, const char*, RawValue const&)>& visit)
82+
void(RawPropsPropNameHash, const char*, const RawValue&)>& visit)
8383
const;
8484

8585
mutable std::vector<RawPropsKey> keys_{};

packages/react-native/ReactCommon/react/renderer/core/ShadowNode.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -313,7 +313,7 @@ const ShadowNodeFamily& ShadowNode::getFamily() const {
313313

314314
ShadowNode::Unshared ShadowNode::cloneTree(
315315
const ShadowNodeFamily& shadowNodeFamily,
316-
const std::function<ShadowNode::Unshared(ShadowNode const& oldShadowNode)>&
316+
const std::function<ShadowNode::Unshared(const ShadowNode& oldShadowNode)>&
317317
callback,
318318
ShadowNodeTraits traits) const {
319319
auto ancestors = shadowNodeFamily.getAncestors(*this);

packages/react-native/ReactCommon/react/renderer/core/ShadowNode.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ class ShadowNode : public Sealable,
101101
*/
102102
Unshared cloneTree(
103103
const ShadowNodeFamily& shadowNodeFamily,
104-
const std::function<Unshared(ShadowNode const& oldShadowNode)>& callback,
104+
const std::function<Unshared(const ShadowNode& oldShadowNode)>& callback,
105105
ShadowNodeTraits traits = {}) const;
106106

107107
#pragma mark - Getters

packages/react-native/ReactCommon/react/renderer/core/ShadowNodeFamily.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class ShadowNodeFamily final {
9191
* Sets and gets the most recent state.
9292
*/
9393
std::shared_ptr<const State> getMostRecentState() const;
94-
void setMostRecentState(const std::shared_ptr<State const>& state) const;
94+
void setMostRecentState(const std::shared_ptr<const State>& state) const;
9595

9696
/*
9797
* Dispatches a state update with given priority.
@@ -134,7 +134,7 @@ class ShadowNodeFamily final {
134134
/*
135135
* Weak reference to the React instance handle
136136
*/
137-
InstanceHandle::Shared const instanceHandle_;
137+
const InstanceHandle::Shared instanceHandle_;
138138

139139
/*
140140
* `EventEmitter` associated with all nodes of the family.

packages/react-native/ReactCommon/react/renderer/core/propsConversions.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -110,8 +110,8 @@ T convertRawProp(
110110
const PropsParserContext& context,
111111
const RawProps& rawProps,
112112
const char* name,
113-
T const& sourceValue,
114-
U const& defaultValue,
113+
const T& sourceValue,
114+
const U& defaultValue,
115115
const char* namePrefix = nullptr,
116116
const char* nameSuffix = nullptr) {
117117
const auto* rawValue = rawProps.at(name, namePrefix, nameSuffix);

0 commit comments

Comments
 (0)