From 104b1f9367a792cc4e4179a01e789ea203fcfe0e Mon Sep 17 00:00:00 2001 From: Evan Bacon Date: Wed, 20 Feb 2019 18:17:25 -0800 Subject: [PATCH] Add HMRLoadingView module for web target (#23389) Summary: * Added a default value for HMRLoadingView this will prevent errors from being thrown when `HMRClient` attempts to include it in a `web` context. * [Web] [Added] - HMRLoadingView Pull Request resolved: https://github.com/facebook/react-native/pull/23389 Differential Revision: D14045475 Pulled By: cpojer fbshipit-source-id: df5c3cf3536af3b37eaf82342b6346bc25054319 --- .flowconfig | 3 +++ .flowconfig.android | 3 +++ Libraries/Utilities/HMRLoadingView.js | 23 +++++++++++++++++++++++ 3 files changed, 29 insertions(+) create mode 100644 Libraries/Utilities/HMRLoadingView.js diff --git a/.flowconfig b/.flowconfig index 435e855a6406f8..9a8ca64d8231e8 100644 --- a/.flowconfig +++ b/.flowconfig @@ -26,6 +26,9 @@ ; require from fbjs/lib instead: require('fbjs/lib/warning') .*/node_modules/warning/.* +; Flow doesn't support platforms +.*/Libraries/Utilities/HMRLoadingView.js + [untyped] .*/node_modules/@react-native-community/cli/.*/.* diff --git a/.flowconfig.android b/.flowconfig.android index 4f9768d14c646a..992ba7e529ea07 100644 --- a/.flowconfig.android +++ b/.flowconfig.android @@ -26,6 +26,9 @@ ; require from fbjs/lib instead: require('fbjs/lib/warning') .*/node_modules/warning/.* +; Flow doesn't support platforms +.*/Libraries/Utilities/HMRLoadingView.js + [untyped] .*/node_modules/@react-native-community/cli/.*/.* diff --git a/Libraries/Utilities/HMRLoadingView.js b/Libraries/Utilities/HMRLoadingView.js new file mode 100644 index 00000000000000..13eaa4bb8f9256 --- /dev/null +++ b/Libraries/Utilities/HMRLoadingView.js @@ -0,0 +1,23 @@ +/** + * Copyright (c) Facebook, Inc. and its affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @format + * @flow strict-local + */ + +'use strict'; + +class HMRLoadingView { + static showMessage(message: string) { + // noop + } + + static hide() { + // noop + } +} + +module.exports = HMRLoadingView;