Skip to content

Commit 62c7920

Browse files
rickhanloniifacebook-github-bot
authored andcommitted
Fast Refresh - Dismiss LogBox syntax errors
Summary: This diff adds Fast Refresh support for dismissing LogBox syntax errors. We don't dismiss all errors because once a syntax error is fixed you'll still want to see the covered fatals, errors, and warnings. If you actually full reload, then it falls back to the native redbox. Changelog: [Internal] Reviewed By: motiz88 Differential Revision: D18278889 fbshipit-source-id: f109ca1d6c34aa3eda6e434deca66f8ce5e02ce0
1 parent 0825c2b commit 62c7920

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Libraries/Utilities/HMRClient.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ const invariant = require('invariant');
1616
const MetroHMRClient = require('metro/src/lib/bundle-modules/HMRClient');
1717

1818
import NativeRedBox from '../NativeModules/specs/NativeRedBox';
19-
19+
import * as LogBoxData from '../LogBox/Data/LogBoxData';
2020
import type {ExtendedError} from '../Core/Devtools/parseErrorStack';
2121

2222
const pendingEntryPoints = [];
@@ -297,6 +297,8 @@ function flushEarlyLogs(client) {
297297
}
298298

299299
function dismissRedbox() {
300+
LogBoxData.clearSyntaxErrors();
301+
300302
if (
301303
Platform.OS === 'ios' &&
302304
NativeRedBox != null &&

0 commit comments

Comments
 (0)