您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

index.native.js 2.4KB

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