mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
037e346197
Summary: This diff runs the codemod to add type annotations to function parameters in preparation for Flow's local type inference (LTI) project. I ran the codemod over xplat/js and reverted any files that had flow errors in them. See the list of commands run to see the regeneration of various files. Changelog: [Internal][Changed] - Added type annotations Reviewed By: yungsters Differential Revision: D32075270 fbshipit-source-id: 6a9cd85aab120b4d9e690bac142a415525dbf298
34 lines
895 B
JavaScript
34 lines
895 B
JavaScript
/**
|
|
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*
|
|
* @flow strict-local
|
|
* @format
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
/**
|
|
* Sets up the console and exception handling (redbox) for React Native.
|
|
* You can use this module directly, or just require InitializeCore.
|
|
*/
|
|
const ExceptionsManager = require('./ExceptionsManager');
|
|
ExceptionsManager.installConsoleErrorReporter();
|
|
|
|
// Set up error handler
|
|
if (!global.__fbDisableExceptionsManager) {
|
|
const handleError = (e: mixed, isFatal: boolean) => {
|
|
try {
|
|
ExceptionsManager.handleException(e, isFatal);
|
|
} catch (ee) {
|
|
console.log('Failed to print error: ', ee.message);
|
|
throw e;
|
|
}
|
|
};
|
|
|
|
const ErrorUtils = require('../vendor/core/ErrorUtils');
|
|
ErrorUtils.setGlobalHandler(handleError);
|
|
}
|