Skip to content

Commit 38bd21b

Browse files
coadometa-codesync[bot]
authored andcommitted
Make ModalHostViewUtils header private (#58883)
Summary: Pull Request resolved: #58883 `react/renderer/components/modal/ModalHostViewUtils.h` declares `ModalHostViewScreenSize()`, a per-platform helper that is only used to compute the default screen size of `ModalHostViewState`. Lower it from "for frameworks" to private. It was reachable from the "for frameworks" API only because `ModalHostViewState.h` called it from an inline default constructor. Move that constructor out of line into `ModalHostViewState.cpp`, so `ModalHostViewState.h` no longer includes the utils header. While here, `ModalHostViewState.h` now gets `Float`/`Size` from the `<React/Graphics.h>` umbrella instead of including the public `react/renderer/graphics/Float.h` directly (`Size` previously only arrived transitively through the utils header). Changelog: [Internal] ___ Differential Revision: D123601668 fbshipit-source-id: c847a73a532f1cb88b9b3b0757be639e2bb25288
1 parent 8aafd80 commit 38bd21b

3 files changed

Lines changed: 7 additions & 4 deletions

File tree

‎packages/react-native/ReactCommon/react/renderer/components/modal/ModalHostViewState.cpp‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,13 @@
66
*/
77

88
#include "ModalHostViewState.h"
9+
#include "ModalHostViewUtils.h"
910

1011
namespace facebook::react {
1112

13+
ModalHostViewState::ModalHostViewState()
14+
: screenSize(ModalHostViewScreenSize()) {}
15+
1216
#ifdef RN_SERIALIZABLE_STATE
1317
folly::dynamic ModalHostViewState::getDynamic() const {
1418
return folly::dynamic::object("screenWidth", screenSize.width)(

‎packages/react-native/ReactCommon/react/renderer/components/modal/ModalHostViewState.h‎

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@
99

1010
#include <react/cxxstableapi/FrameworksGuard.h>
1111

12+
#include <React/Graphics.h>
1213
#include <React/RendererCore.h>
13-
#include <react/renderer/graphics/Float.h>
14-
#include "ModalHostViewUtils.h"
1514

1615
#ifdef RN_SERIALIZABLE_STATE
1716
#include <folly/dynamic.h>
@@ -26,7 +25,7 @@ class ModalHostViewState final {
2625
public:
2726
using Shared = std::shared_ptr<const ModalHostViewState>;
2827

29-
ModalHostViewState() : screenSize(ModalHostViewScreenSize()) {}
28+
ModalHostViewState();
3029
ModalHostViewState(Size screenSize_) : screenSize(screenSize_) {};
3130

3231
#ifdef RN_SERIALIZABLE_STATE

‎packages/react-native/ReactCommon/react/renderer/components/modal/ModalHostViewUtils.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
#pragma once
99

10-
#include <react/cxxstableapi/FrameworksGuard.h>
10+
#include <react/cxxstableapi/PrivateGuard.h>
1111

1212
#include <react/renderer/graphics/Size.h>
1313

0 commit comments

Comments
 (0)