Skip to content

Commit

Permalink
Add HMRLoadingView module for web target (#23389)
Browse files Browse the repository at this point in the history
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: #23389

Differential Revision: D14045475

Pulled By: cpojer

fbshipit-source-id: df5c3cf3536af3b37eaf82342b6346bc25054319
  • Loading branch information
EvanBacon authored and facebook-github-bot committed Feb 21, 2019
1 parent b0c69ab commit 104b1f9
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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/.*/.*

Expand Down
3 changes: 3 additions & 0 deletions .flowconfig.android
Original file line number Diff line number Diff line change
Expand Up @@ -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/.*/.*

Expand Down
23 changes: 23 additions & 0 deletions Libraries/Utilities/HMRLoadingView.js
Original file line number Diff line number Diff line change
@@ -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;

0 comments on commit 104b1f9

Please sign in to comment.