MCPcopy Create free account
hub / github.com/krasimir/react-in-patterns / catchErrors

Function catchErrors

code/new-context-api/public/app.js:6474–6485  ·  view source on GitHub ↗
(fn)

Source from the content-addressed store, hash-verified

6472var hasLoggedError = false;
6473
6474function catchErrors(fn) {
6475 return function (arg) {
6476 try {
6477 return fn(arg);
6478 } catch (err) {
6479 if (true && !hasLoggedError) {
6480 hasLoggedError = true;
6481 warning(false, 'React DevTools encountered an error: %s', err);
6482 }
6483 }
6484 };
6485}
6486
6487function injectInternals(internals) {
6488 if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ === 'undefined') {

Callers 1

injectInternalsFunction · 0.70

Calls 1

warningFunction · 0.85

Tested by

no test coverage detected