mirror of
https://github.com/zhigang1992/react-native.git
synced 2026-04-24 04:16:00 +08:00
Show red boxes on HL mode
Summary: public We should further improve this on the future by showing the actual stacktrace instead of the `HMRClient` one. Also, we need to integrate this with the dev plugin that opens in the default editor the file/line the user clicks on. Reviewed By: vjeux Differential Revision: D2798889 fb-gh-sync-id: 2392966908c493e86e11b0d024e7b68156c9066c
This commit is contained in:
committed by
facebook-github-bot-4
parent
e46736219c
commit
fe77ce1c62
@@ -48,8 +48,16 @@ URL: ${host}:${port}
|
||||
Error: ${e.message}`
|
||||
);
|
||||
};
|
||||
activeWS.onmessage = (m) => {
|
||||
eval(m.data); // eslint-disable-line no-eval
|
||||
activeWS.onmessage = ({data}) => {
|
||||
data = JSON.parse(data);
|
||||
if (data.type === 'update') {
|
||||
eval(data.body); // eslint-disable-line no-eval
|
||||
return;
|
||||
}
|
||||
|
||||
// TODO: add support for opening filename by clicking on the stacktrace
|
||||
const error = data.body;
|
||||
throw new Error(error.type + ' ' + error.description);
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user