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.

index.native.js 2.3KB

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