mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
LogBox - Only dismiss syntax errors when the issue is fixed
Summary: This change is not only more correct, it's also fixes the modal in the the next diff. It's more accurate because in the previous location, the redbox dismissal was done as a hack in order to hide non-syntax errors so that the syntax error would be visible when it fired. This is unnecessary for LogBox because it always puts syntax errors on top of any other error. The main motivation for changing this, however, is that this strategy is broken when switching to the Modal component because the Modal component does not work well with quickly unmounting and remounting. With the old strategy, the inspector would flicker and then collapse even though there was a syntax error. Changelog: [Internal] Reviewed By: cpojer, gaearon Differential Revision: D18461431 fbshipit-source-id: e8ed83e3d2b002e5d45cc13dc9533ed841ed5cae
This commit is contained in:
committed by
Facebook Github Bot
parent
32eb05ebea
commit
c54f5cf72a
@@ -211,6 +211,7 @@ Error: ${e.message}`;
|
||||
client.on('update', ({isInitialUpdate}) => {
|
||||
if (client.isEnabled() && !isInitialUpdate) {
|
||||
dismissRedbox();
|
||||
LogBoxData.clearSyntaxErrors();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -297,8 +298,6 @@ function flushEarlyLogs(client) {
|
||||
}
|
||||
|
||||
function dismissRedbox() {
|
||||
LogBoxData.clearSyntaxErrors();
|
||||
|
||||
if (
|
||||
Platform.OS === 'ios' &&
|
||||
NativeRedBox != null &&
|
||||
|
||||
Reference in New Issue
Block a user