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.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. // @flow
  2. // https://github.com/software-mansion/react-native-gesture-handler/issues/320#issuecomment-443815828
  3. import 'react-native-gesture-handler';
  4. // Apply all necessary polyfills as early as possible to make sure anything imported henceforth
  5. // sees them.
  6. import 'react-native-get-random-values';
  7. import './features/mobile/polyfills';
  8. import React, { PureComponent } from 'react';
  9. import { AppRegistry } from 'react-native';
  10. import { App } from './features/app/components';
  11. import { _initLogging } from './features/base/logging/functions';
  12. import JitsiThemePaperProvider
  13. from './features/base/ui/components/JitsiThemeProvider';
  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. * @augments 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. return (
  40. <JitsiThemePaperProvider>
  41. <App
  42. { ...this.props } />
  43. </JitsiThemePaperProvider>
  44. );
  45. }
  46. }
  47. // Initialize logging.
  48. _initLogging();
  49. // HORRIBLE HACK ALERT! React Native logs the initial props with `console.log`. Here we are quickly patching it
  50. // to avoid logging potentially sensitive information.
  51. if (!__DEV__) {
  52. /* eslint-disable */
  53. const __orig_console_log = console.log;
  54. const __orig_appregistry_runapplication = AppRegistry.runApplication;
  55. AppRegistry.runApplication = (...args) => {
  56. // $FlowExpectedError
  57. console.log = () => {};
  58. __orig_appregistry_runapplication(...args);
  59. // $FlowExpectedError
  60. console.log = __orig_console_log;
  61. };
  62. /* eslint-enable */
  63. }
  64. // Register the main/root Component of JitsiMeetView.
  65. AppRegistry.registerComponent('App', () => Root);