選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

index.native.js 2.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. //
  48. window.root={r:ret,that:this}
  49. return ret
  50. }
  51. }
  52. // Initialize logging.
  53. _initLogging();
  54. // HORRIBLE HACK ALERT! React Native logs the initial props with `console.log`. Here we are quickly patching it
  55. // to avoid logging potentially sensitive information.
  56. if (!__DEV__) {
  57. /* eslint-disable */
  58. const __orig_console_log = console.log;
  59. const __orig_appregistry_runapplication = AppRegistry.runApplication;
  60. AppRegistry.runApplication = (...args) => {
  61. // $FlowExpectedError
  62. console.log = () => {};
  63. __orig_appregistry_runapplication(...args);
  64. // $FlowExpectedError
  65. console.log = __orig_console_log;
  66. };
  67. /* eslint-enable */
  68. }
  69. // Register the main/root Component of JitsiMeetView.
  70. AppRegistry.registerComponent('App', () => Root);
  71. // Register the main/root Component of IncomingCallView.
  72. AppRegistry.registerComponent('IncomingCallApp', () => IncomingCallApp);