mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
6b22a4e802
Summary: This diff adds a NativeLogBox module implementation on iOS to manage rendering LogBox the way we render RedBox, except rendering a React Native component instead of a native view. The strategy here is: - initialize: will create a hidden window (the way redbox does) and render the LogBox to it - show: will show the window - hide: will hide the window Most of this is copied from the way RedBox works, the difference here is that we eagerly initialize the window with the `initialize` function so that it's warm by the time LogBox needs to render. Changelog: [Internal] Reviewed By: RSNara Differential Revision: D18750008 fbshipit-source-id: 013e55ded55c8572bb08e0219ff4cd0060ebe0da
22 lines
557 B
JavaScript
22 lines
557 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
|
|
* @format
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
import type {TurboModule} from 'react-native/Libraries/TurboModule/RCTExport';
|
|
import * as TurboModuleRegistry from 'react-native/Libraries/TurboModule/TurboModuleRegistry';
|
|
|
|
export interface Spec extends TurboModule {
|
|
+show: () => void;
|
|
+hide: () => void;
|
|
}
|
|
|
|
export default (TurboModuleRegistry.get<Spec>('LogBox'): ?Spec);
|