1*26ad19fcSEvan Bacon// This needs to run before the renderer initializes.
2*26ad19fcSEvan Bacon
3*26ad19fcSEvan Baconconst ReactRefreshRuntime = require('react-refresh/runtime');
4*26ad19fcSEvan BaconReactRefreshRuntime.injectIntoGlobalHook(global);
5*26ad19fcSEvan Bacon
6*26ad19fcSEvan Baconconst Refresh = {
7*26ad19fcSEvan Bacon  performFullRefresh() {
8*26ad19fcSEvan Bacon    location.reload();
9*26ad19fcSEvan Bacon  },
10*26ad19fcSEvan Bacon
11*26ad19fcSEvan Bacon  createSignatureFunctionForTransform: ReactRefreshRuntime.createSignatureFunctionForTransform,
12*26ad19fcSEvan Bacon
13*26ad19fcSEvan Bacon  isLikelyComponentType: ReactRefreshRuntime.isLikelyComponentType,
14*26ad19fcSEvan Bacon
15*26ad19fcSEvan Bacon  getFamilyByType: ReactRefreshRuntime.getFamilyByType,
16*26ad19fcSEvan Bacon
17*26ad19fcSEvan Bacon  register: ReactRefreshRuntime.register,
18*26ad19fcSEvan Bacon
19*26ad19fcSEvan Bacon  performReactRefresh() {
20*26ad19fcSEvan Bacon    if (ReactRefreshRuntime.hasUnrecoverableErrors()) {
21*26ad19fcSEvan Bacon      location.reload();
22*26ad19fcSEvan Bacon      return;
23*26ad19fcSEvan Bacon    }
24*26ad19fcSEvan Bacon    ReactRefreshRuntime.performReactRefresh();
25*26ad19fcSEvan Bacon  },
26*26ad19fcSEvan Bacon};
27*26ad19fcSEvan Bacon
28*26ad19fcSEvan Bacon// The metro require polyfill can not have dependencies (applies for all polyfills).
29*26ad19fcSEvan Bacon// Expose `Refresh` by assigning it to global to make it available in the polyfill.
30*26ad19fcSEvan Baconglobal[(global.__METRO_GLOBAL_PREFIX__ || '') + '__ReactRefresh'] = Refresh;
31