mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
93aab84699
Summary: I originally added `forceFullRefresh` as an escape hatch in case Fast Refresh is too unreliable. In practice we haven't seen any major issues with it. Since this option is already very obscure, I'm just removing it. Reviewed By: shergin Differential Revision: D16286632 fbshipit-source-id: c3dc44cffd459912e194e273acf868f3380c64cc
43 lines
1.1 KiB
JavaScript
43 lines
1.1 KiB
JavaScript
/**
|
|
* 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.
|
|
*
|
|
* @flow
|
|
* @format
|
|
*/
|
|
'use strict';
|
|
|
|
if (__DEV__) {
|
|
const NativeDevSettings = require('../NativeModules/specs/NativeDevSettings')
|
|
.default;
|
|
|
|
if (typeof NativeDevSettings.reload !== 'function') {
|
|
throw new Error('Could not find the reload() implementation.');
|
|
}
|
|
|
|
// This needs to run before the renderer initializes.
|
|
const ReactRefreshRuntime = require('react-refresh/runtime');
|
|
ReactRefreshRuntime.injectIntoGlobalHook(global);
|
|
|
|
const Refresh = {
|
|
performFullRefresh() {
|
|
NativeDevSettings.reload();
|
|
},
|
|
|
|
createSignatureFunctionForTransform:
|
|
ReactRefreshRuntime.createSignatureFunctionForTransform,
|
|
|
|
isLikelyComponentType: ReactRefreshRuntime.isLikelyComponentType,
|
|
|
|
getFamilyByType: ReactRefreshRuntime.getFamilyByType,
|
|
|
|
register: ReactRefreshRuntime.register,
|
|
|
|
performReactRefresh: ReactRefreshRuntime.performReactRefresh,
|
|
};
|
|
|
|
(require: any).Refresh = Refresh;
|
|
}
|