Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

index.native.js 2.2KB

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