Skip to content

Commit e8ad1a6

Browse files
authored
Merge pull request #96 from pmmmwh/enhancement/metro-tests
2 parents 9a60c7c + 02e285f commit e8ad1a6

File tree

7 files changed

+882
-305
lines changed

7 files changed

+882
-305
lines changed

src/runtime/refreshUtils.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* global __react_refresh_error_overlay__ */
1+
/* global __react_refresh_error_overlay__, __react_refresh_test__ */
22
const Refresh = require('react-refresh/runtime');
33

44
/**
@@ -78,6 +78,12 @@ function createHotErrorHandler(moduleId) {
7878
if (__react_refresh_error_overlay__) {
7979
__react_refresh_error_overlay__.handleRuntimeError(error);
8080
}
81+
82+
if (typeof __react_refresh_test__ !== 'undefined') {
83+
if (window.onHotAcceptError) {
84+
window.onHotAcceptError(error.message);
85+
}
86+
}
8187
}
8288

8389
/**

0 commit comments

Comments
 (0)