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.4KB

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