Skip to content

Commit bb120ff

Browse files
sammy-SCfacebook-github-bot
authored andcommitted
remove force_static from textinput module
Summary: changelog: [internal] force_static doesn't need to be in here, let's remove it. I change one module per diff. It makes it easier to land it and pinpoint where build failures are coming from. Reviewed By: christophpurrer Differential Revision: D56678530 fbshipit-source-id: c602e065d77fdd649c66ce2d26eee83428ef5ba8
1 parent bb2c13a commit bb120ff

File tree

2 files changed

+33
-15
lines changed

2 files changed

+33
-15
lines changed
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/*
2+
* Copyright (c) Meta Platforms, Inc. and affiliates.
3+
*
4+
* This source code is licensed under the MIT license found in the
5+
* LICENSE file in the root directory of this source tree.
6+
*/
7+
8+
#include "ImageComponentDescriptor.h"
9+
#include <react/renderer/imagemanager/ImageManager.h>
10+
11+
namespace facebook::react {
12+
13+
ImageComponentDescriptor::ImageComponentDescriptor(
14+
const ComponentDescriptorParameters& parameters)
15+
: ConcreteComponentDescriptor(parameters),
16+
imageManager_(std::make_shared<ImageManager>(contextContainer_)){};
17+
18+
void ImageComponentDescriptor::adopt(ShadowNode& shadowNode) const {
19+
ConcreteComponentDescriptor::adopt(shadowNode);
20+
21+
auto& imageShadowNode = static_cast<ImageShadowNode&>(shadowNode);
22+
23+
// `ImageShadowNode` uses `ImageManager` to initiate image loading and
24+
// communicate the loading state and results to mounting layer.
25+
imageShadowNode.setImageManager(imageManager_);
26+
}
27+
} // namespace facebook::react

packages/react-native/ReactCommon/react/renderer/components/image/ImageComponentDescriptor.h

Lines changed: 6 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,33 +9,24 @@
99

1010
#include <react/renderer/components/image/ImageShadowNode.h>
1111
#include <react/renderer/core/ConcreteComponentDescriptor.h>
12-
#include <react/renderer/imagemanager/ImageManager.h>
13-
#include <react/utils/ContextContainer.h>
1412

1513
namespace facebook::react {
1614

15+
class ImageManager;
16+
1717
/*
1818
* Descriptor for <Image> component.
1919
*/
2020
class ImageComponentDescriptor final
2121
: public ConcreteComponentDescriptor<ImageShadowNode> {
2222
public:
23-
ImageComponentDescriptor(const ComponentDescriptorParameters& parameters)
24-
: ConcreteComponentDescriptor(parameters),
25-
imageManager_(std::make_shared<ImageManager>(contextContainer_)){};
26-
27-
void adopt(ShadowNode& shadowNode) const override {
28-
ConcreteComponentDescriptor::adopt(shadowNode);
29-
30-
auto& imageShadowNode = static_cast<ImageShadowNode&>(shadowNode);
23+
explicit ImageComponentDescriptor(
24+
const ComponentDescriptorParameters& parameters);
3125

32-
// `ImageShadowNode` uses `ImageManager` to initiate image loading and
33-
// communicate the loading state and results to mounting layer.
34-
imageShadowNode.setImageManager(imageManager_);
35-
}
26+
void adopt(ShadowNode& shadowNode) const override;
3627

3728
private:
38-
const SharedImageManager imageManager_;
29+
const std::shared_ptr<ImageManager> imageManager_;
3930
};
4031

4132
} // namespace facebook::react

0 commit comments

Comments
 (0)