Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

index.native.js 2.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. window.clog3= console.log
  64. const __orig_appregistry_runapplication = AppRegistry.runApplication;
  65. AppRegistry.runApplication = (...args) => {
  66. // $FlowExpectedError
  67. console.log = () => {};
  68. __orig_appregistry_runapplication(...args);
  69. // $FlowExpectedError
  70. console.log = __orig_console_log;
  71. };
  72. /* eslint-enable */
  73. }
  74. // Register the main/root Component of JitsiMeetView.
  75. AppRegistry.registerComponent('App', () => Root);
  76. // Register the main/root Component of IncomingCallView.
  77. AppRegistry.registerComponent('IncomingCallApp', () => IncomingCallApp);