You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. // @flow
  2. // Apply all necessary polyfills as early as possible to make sure anything imported henceforth
  3. // sees them.
  4. import './features/mobile/polyfills';
  5. import React, { PureComponent } from 'react';
  6. import { AppRegistry } from 'react-native';
  7. import { App } from './features/app/components';
  8. import { _initLogging } from './features/base/logging/functions';
  9. import JitsiThemePaperProvider
  10. from './features/base/ui/components/JitsiThemeProvider';
  11. import { IncomingCallApp } from './features/mobile/incoming-call';
  12. declare var __DEV__;
  13. /**
  14. * The type of the React {@code Component} props of {@link Root}.
  15. */
  16. type Props = {
  17. /**
  18. * The URL, if any, with which the app was launched.
  19. */
  20. url: Object | string
  21. };
  22. /**
  23. * React Native doesn't support specifying props to the main/root component (in
  24. * the JS/JSX source code). So create a wrapper React Component (class) around
  25. * features/app's App instead.
  26. *
  27. * @extends Component
  28. */
  29. class Root extends PureComponent<Props> {
  30. /**
  31. * Implements React's {@link Component#render()}.
  32. *
  33. * @inheritdoc
  34. * @returns {ReactElement}
  35. */
  36. render() {
  37. return (
  38. <JitsiThemePaperProvider>
  39. <App
  40. { ...this.props } />
  41. </JitsiThemePaperProvider>
  42. );
  43. }
  44. }
  45. // Initialize logging.
  46. _initLogging();
  47. // HORRIBLE HACK ALERT! React Native logs the initial props with `console.log`. Here we are quickly patching it
  48. // to avoid logging potentially sensitive information.
  49. if (!__DEV__) {
  50. /* eslint-disable */
  51. const __orig_console_log = console.log;
  52. const __orig_appregistry_runapplication = AppRegistry.runApplication;
  53. AppRegistry.runApplication = (...args) => {
  54. // $FlowExpectedError
  55. console.log = () => {};
  56. __orig_appregistry_runapplication(...args);
  57. // $FlowExpectedError
  58. console.log = __orig_console_log;
  59. };
  60. /* eslint-enable */
  61. }
  62. // Register the main/root Component of JitsiMeetView.
  63. AppRegistry.registerComponent('App', () => Root);
  64. // Register the main/root Component of IncomingCallView.
  65. AppRegistry.registerComponent('IncomingCallApp', () => IncomingCallApp);