Skip to content

Commit 99d407d

Browse files
ios|android textInput > Remove #ifdef ANDROID when not needed (facebook#41569)
Summary: Pull Request resolved: facebook#41569 Changelog: [Internal] Reviewed By: rshest Differential Revision: D51479729 fbshipit-source-id: 0dd78e568b98c93446a59e5f1242d26a24d9fff2
1 parent b58cba7 commit 99d407d

File tree

5 files changed

+3
-52
lines changed

5 files changed

+3
-52
lines changed

packages/react-native/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputProps.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,13 @@ static inline std::string toString(
5050
return "[Object AndroidTextInputTextShadowOffsetStruct]";
5151
}
5252

53-
#ifdef ANDROID
5453
inline folly::dynamic toDynamic(
5554
const AndroidTextInputTextShadowOffsetStruct& value) {
5655
folly::dynamic dynamicValue = folly::dynamic::object();
5756
dynamicValue["width"] = value.width;
5857
dynamicValue["height"] = value.height;
5958
return dynamicValue;
6059
}
61-
#endif
6260

6361
class AndroidTextInputProps final : public ViewProps, public BaseTextProps {
6462
public:

packages/react-native/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputState.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,8 @@
99

1010
#include <react/renderer/components/text/conversions.h>
1111
#include <react/renderer/debug/debugStringConvertibleUtils.h>
12-
13-
#ifdef ANDROID
1412
#include <react/renderer/mapbuffer/MapBuffer.h>
1513
#include <react/renderer/mapbuffer/MapBufferBuilder.h>
16-
#endif
1714

1815
#include <utility>
1916

@@ -68,7 +65,6 @@ AndroidTextInputState::AndroidTextInputState(
6865
previousState.defaultThemePaddingBottom)
6966
.getDouble()){};
7067

71-
#ifdef ANDROID
7268
folly::dynamic AndroidTextInputState::getDynamic() const {
7369
// Java doesn't need all fields, so we don't pass them all along.
7470
folly::dynamic newState = folly::dynamic::object();
@@ -104,6 +100,4 @@ MapBuffer AndroidTextInputState::getMapBuffer() const {
104100
return builder.build();
105101
}
106102

107-
#endif
108-
109103
} // namespace facebook::react

packages/react-native/ReactCommon/react/renderer/components/textinput/androidtextinput/react/renderer/components/androidtextinput/AndroidTextInputState.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,12 @@
77

88
#pragma once
99

10+
#include <folly/dynamic.h>
1011
#include <react/renderer/attributedstring/AttributedString.h>
1112
#include <react/renderer/attributedstring/ParagraphAttributes.h>
12-
#include <react/renderer/textlayoutmanager/TextLayoutManager.h>
13-
14-
#ifdef ANDROID
15-
#include <folly/dynamic.h>
1613
#include <react/renderer/mapbuffer/MapBuffer.h>
1714
#include <react/renderer/mapbuffer/MapBufferBuilder.h>
18-
#endif
15+
#include <react/renderer/textlayoutmanager/TextLayoutManager.h>
1916

2017
namespace facebook::react {
2118

packages/react-native/ReactCommon/react/renderer/components/textinput/iostextinput/react/renderer/components/iostextinput/TextInputState.cpp

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,4 @@
77

88
#include "TextInputState.h"
99

10-
namespace facebook::react {
11-
12-
#ifdef ANDROID
13-
TextInputState::TextInputState(
14-
const TextInputState& /*previousState*/,
15-
const folly::dynamic& /*data*/){};
16-
17-
/*
18-
* Empty implementation for Android because it doesn't use this class.
19-
*/
20-
folly::dynamic TextInputState::getDynamic() const {
21-
return {};
22-
};
23-
24-
/*
25-
* Empty implementation for Android because it doesn't use this class.
26-
*/
27-
MapBuffer TextInputState::getMapBuffer() const {
28-
return MapBufferBuilder::EMPTY();
29-
};
30-
#endif
31-
32-
} // namespace facebook::react
10+
namespace facebook::react {} // namespace facebook::react

packages/react-native/ReactCommon/react/renderer/components/textinput/iostextinput/react/renderer/components/iostextinput/TextInputState.h

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,6 @@
1111
#include <react/renderer/attributedstring/ParagraphAttributes.h>
1212
#include <react/renderer/textlayoutmanager/TextLayoutManager.h>
1313

14-
#ifdef ANDROID
15-
#include <folly/dynamic.h>
16-
#include <react/renderer/mapbuffer/MapBuffer.h>
17-
#include <react/renderer/mapbuffer/MapBufferBuilder.h>
18-
#endif
19-
2014
namespace facebook::react {
2115

2216
/*
@@ -54,16 +48,6 @@ class TextInputState final {
5448
std::shared_ptr<const TextLayoutManager> layoutManager;
5549

5650
size_t mostRecentEventCount{0};
57-
58-
#ifdef ANDROID
59-
TextInputState(
60-
const TextInputState& previousState,
61-
const folly::dynamic& data);
62-
63-
folly::dynamic getDynamic() const;
64-
65-
MapBuffer getMapBuffer() const;
66-
#endif
6751
};
6852

6953
} // namespace facebook::react

0 commit comments

Comments
 (0)