Files
jitsi-meet/react/index.native.js
Saúl Ibarra Corretgé c84e6eecdd feat(rn) drop incoming call handling
This "feature" has been dead (and most likely buggy) for years. The
recommended way is for apps to implement their own incoming call
handling and then call into the JitsiMeetActivity. We did not have those
APIs back then.
2022-02-22 13:54:21 +01:00

81 lines
2.1 KiB
JavaScript

// @flow
// https://github.com/software-mansion/react-native-gesture-handler/issues/320#issuecomment-443815828
import 'react-native-gesture-handler';
// Apply all necessary polyfills as early as possible to make sure anything imported henceforth
// sees them.
import 'react-native-get-random-values';
import './features/mobile/polyfills';
import React, { PureComponent } from 'react';
import { AppRegistry } from 'react-native';
import { App } from './features/app/components';
import { _initLogging } from './features/base/logging/functions';
import JitsiThemePaperProvider
from './features/base/ui/components/JitsiThemeProvider';
declare var __DEV__;
/**
* The type of the React {@code Component} props of {@link Root}.
*/
type Props = {
/**
* The URL, if any, with which the app was launched.
*/
url: Object | string
};
/**
* React Native doesn't support specifying props to the main/root component (in
* the JS/JSX source code). So create a wrapper React Component (class) around
* features/app's App instead.
*
* @augments Component
*/
class Root extends PureComponent<Props> {
/**
* Implements React's {@link Component#render()}.
*
* @inheritdoc
* @returns {ReactElement}
*/
render() {
return (
<JitsiThemePaperProvider>
<App
{ ...this.props } />
</JitsiThemePaperProvider>
);
}
}
// Initialize logging.
_initLogging();
// HORRIBLE HACK ALERT! React Native logs the initial props with `console.log`. Here we are quickly patching it
// to avoid logging potentially sensitive information.
if (!__DEV__) {
/* eslint-disable */
const __orig_console_log = console.log;
const __orig_appregistry_runapplication = AppRegistry.runApplication;
AppRegistry.runApplication = (...args) => {
// $FlowExpectedError
console.log = () => {};
__orig_appregistry_runapplication(...args);
// $FlowExpectedError
console.log = __orig_console_log;
};
/* eslint-enable */
}
// Register the main/root Component of JitsiMeetView.
AppRegistry.registerComponent('App', () => Root);