Use pre-bundled elements inspector
Reviewed By: spicyj Differential Revision: D2588448 fb-gh-sync-id: 278631c1de78cac2bfd9950809feddbe3f630ad0
This commit is contained in:
parent
22cc044a67
commit
9a93a3cba4
|
@ -14,7 +14,7 @@
|
|||
function setupDevtools() {
|
||||
var messageListeners = [];
|
||||
var closeListeners = [];
|
||||
var ws = new window.WebSocket('ws://localhost:8081/devtools');
|
||||
var ws = new window.WebSocket('ws://localhost:8097/devtools');
|
||||
// this is accessed by the eval'd backend code
|
||||
var FOR_BACKEND = { // eslint-disable-line no-unused-vars
|
||||
resolveRNStyle: require('flattenStyle'),
|
||||
|
@ -31,11 +31,11 @@ function setupDevtools() {
|
|||
},
|
||||
};
|
||||
ws.onclose = () => {
|
||||
console.warn('devtools socket closed');
|
||||
setTimeout(setupDevtools, 200);
|
||||
closeListeners.forEach(fn => fn());
|
||||
};
|
||||
ws.onerror = error => {
|
||||
console.warn('devtools socket errored', error);
|
||||
setTimeout(setupDevtools, 200);
|
||||
closeListeners.forEach(fn => fn());
|
||||
};
|
||||
ws.onopen = function () {
|
||||
|
@ -58,7 +58,7 @@ function setupDevtools() {
|
|||
// FOR_BACKEND is used by the eval'd code
|
||||
eval(text); // eslint-disable-line no-eval
|
||||
} catch (e) {
|
||||
console.error('Failed to eval' + e.message);
|
||||
console.error('Failed to eval: ' + e.message);
|
||||
return;
|
||||
}
|
||||
window.__REACT_DEVTOOLS_GLOBAL_HOOK__.inject({
|
||||
|
|
Loading…
Reference in New Issue