2018-07-15 14:50:38 +00:00
|
|
|
// @flow
|
|
|
|
|
2022-01-14 10:44:02 +00:00
|
|
|
// https://github.com/software-mansion/react-native-gesture-handler/issues/320#issuecomment-443815828
|
|
|
|
import 'react-native-gesture-handler';
|
|
|
|
|
2020-05-06 09:22:09 +00:00
|
|
|
// Apply all necessary polyfills as early as possible to make sure anything imported henceforth
|
|
|
|
// sees them.
|
2021-10-25 10:04:51 +00:00
|
|
|
import 'react-native-get-random-values';
|
2020-05-06 09:22:09 +00:00
|
|
|
import './features/mobile/polyfills';
|
2020-05-06 08:53:23 +00:00
|
|
|
|
2019-01-24 15:53:28 +00:00
|
|
|
import React, { PureComponent } from 'react';
|
|
|
|
import { AppRegistry } from 'react-native';
|
2016-10-05 14:36:59 +00:00
|
|
|
|
2020-06-04 14:09:13 +00:00
|
|
|
import { App } from './features/app/components';
|
2019-08-28 10:31:38 +00:00
|
|
|
import { _initLogging } from './features/base/logging/functions';
|
2021-05-12 16:13:03 +00:00
|
|
|
import JitsiThemePaperProvider
|
|
|
|
from './features/base/ui/components/JitsiThemeProvider';
|
2019-08-28 10:31:38 +00:00
|
|
|
|
2019-05-29 11:58:50 +00:00
|
|
|
declare var __DEV__;
|
|
|
|
|
2018-07-16 16:36:32 +00:00
|
|
|
/**
|
|
|
|
* The type of the React {@code Component} props of {@link Root}.
|
|
|
|
*/
|
2018-07-15 14:50:38 +00:00
|
|
|
type Props = {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* The URL, if any, with which the app was launched.
|
|
|
|
*/
|
|
|
|
url: Object | string
|
|
|
|
};
|
|
|
|
|
2016-10-05 14:36:59 +00:00
|
|
|
/**
|
|
|
|
* 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.
|
|
|
|
*
|
2021-11-04 21:10:43 +00:00
|
|
|
* @augments Component
|
2016-10-05 14:36:59 +00:00
|
|
|
*/
|
2019-01-24 15:53:28 +00:00
|
|
|
class Root extends PureComponent<Props> {
|
2016-10-05 14:36:59 +00:00
|
|
|
/**
|
|
|
|
* Implements React's {@link Component#render()}.
|
|
|
|
*
|
|
|
|
* @inheritdoc
|
|
|
|
* @returns {ReactElement}
|
|
|
|
*/
|
|
|
|
render() {
|
|
|
|
return (
|
2021-05-12 16:13:03 +00:00
|
|
|
<JitsiThemePaperProvider>
|
|
|
|
<App
|
|
|
|
{ ...this.props } />
|
|
|
|
</JitsiThemePaperProvider>
|
2016-10-05 14:36:59 +00:00
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-08-28 10:31:38 +00:00
|
|
|
// Initialize logging.
|
|
|
|
_initLogging();
|
|
|
|
|
2019-05-29 11:58:50 +00:00
|
|
|
// 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 */
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2018-07-16 16:36:32 +00:00
|
|
|
// Register the main/root Component of JitsiMeetView.
|
2016-10-05 14:36:59 +00:00
|
|
|
AppRegistry.registerComponent('App', () => Root);
|