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

index.native.js 2.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. declare var __DEV__;
  15. /**
  16. * The type of the React {@code Component} props of {@link Root}.
  17. */
  18. type Props = {
  19. /**
  20. * The URL, if any, with which the app was launched.
  21. */
  22. url: Object | string
  23. };
  24. /**
  25. * React Native doesn't support specifying props to the main/root component (in
  26. * the JS/JSX source code). So create a wrapper React Component (class) around
  27. * features/app's App instead.
  28. *
  29. * @extends Component
  30. */
  31. class Root extends PureComponent<Props> {
  32. /**
  33. * Implements React's {@link Component#render()}.
  34. *
  35. * @inheritdoc
  36. * @returns {ReactElement}
  37. */
  38. render() {
  39. console.log("ROOT!...")
  40. // return (
  41. var ret = (
  42. <JitsiThemePaperProvider>
  43. <App
  44. { ...this.props } />
  45. </JitsiThemePaperProvider>
  46. );
  47. return ret
  48. }
  49. }
  50. // Initialize logging.
  51. _initLogging();
  52. // HORRIBLE HACK ALERT! React Native logs the initial props with `console.log`. Here we are quickly patching it
  53. // to avoid logging potentially sensitive information.
  54. if (!__DEV__) {
  55. /* eslint-disable */
  56. const __orig_console_log = console.log;
  57. const __orig_appregistry_runapplication = AppRegistry.runApplication;
  58. AppRegistry.runApplication = (...args) => {
  59. // $FlowExpectedError
  60. console.log = () => {};
  61. __orig_appregistry_runapplication(...args);
  62. // $FlowExpectedError
  63. console.log = __orig_console_log;
  64. };
  65. /* eslint-enable */
  66. }
  67. // Register the main/root Component of JitsiMeetView.
  68. AppRegistry.registerComponent('App', () => Root);
  69. // Register the main/root Component of IncomingCallView.
  70. AppRegistry.registerComponent('IncomingCallApp', () => IncomingCallApp);