Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
import React, { Component } from 'react'
import ReactDOM from 'react-dom'
import * as ReactNative from 'react-native-web'
import PropTypes from 'prop-types'
import pureRender from 'pure-render-decorator'
import VendorComponents from './VendorComponents'
import consoleProxy, { consoleLog, consoleClear } from './ConsoleProxy'
import { prefixObject } from '../../utils/PrefixInlineStyles'
const AppRegistry = ReactNative.AppRegistry
window._consoleProxy = consoleProxy
// Make regeneratorRuntime globally available for async/await
window.regeneratorRuntime = require('regenerator-runtime')
const APP_NAME = 'App'
// Override registerComponent in order to ignore the name used
const registerComponent = AppRegistry.registerComponent.bind(AppRegistry)
AppRegistry.registerComponent = (name, f) => {
registerComponent(APP_NAME, f)
window._didRegisterComponent = true
}
const prefix = `
var _reactNativeWeb=require("react-native-web");
var registerComponent=_reactNativeWeb.AppRegistry.registerComponent;
var getApplication=_reactNativeWeb.AppRegistry.getApplication;
var appRoutes={};
_reactNativeWeb.AppRegistry.registerComponent=function(appKey,getComponentFunc,getRouterFunc){
if(typeof getRouterFunc=='function'){
appRoutes[appKey]=getRouterFunc();
}
var _reactNativeWeb=require("react-native-web");
var registerComponent=_reactNativeWeb.AppRegistry.registerComponent;
var getApplication=_reactNativeWeb.AppRegistry.getApplication;
var appRoutes={};
_reactNativeWeb.AppRegistry.registerComponent=function(appKey,getComponentFunc,getRouterFunc){
if(typeof getRouterFunc=='function'){
appRoutes[appKey]=getRouterFunc();
}
return registerComponent.call(this,appKey,getComponentFunc);
};
get: function get() {
return _reactNativeWeb.AppRegistry;
}
});
_reactNativeWeb.AppRegistry.registerComponent=function(appKey,getComponentFunc,getRouterFunc){
if(typeof getRouterFunc=='function'){
appRoutes[appKey]=getRouterFunc();
}
return registerComponent.call(this,appKey,getComponentFunc);
};
_reactNativeWeb.AppRegistry.getApplication=function(appKey,appParameters){
var application=getApplication.call(this,appKey,appParameters);
application.routers=appRoutes[appKey];
return application;
};
var registerComponent=_reactNativeWeb.AppRegistry.registerComponent;
var getApplication=_reactNativeWeb.AppRegistry.getApplication;
var appRoutes={};
_reactNativeWeb.AppRegistry.registerComponent=function(appKey,getComponentFunc,getRouterFunc){
if(typeof getRouterFunc=='function'){
appRoutes[appKey]=getRouterFunc();
}
return registerComponent.call(this,appKey,getComponentFunc);
};
_reactNativeWeb.AppRegistry.getApplication=function(appKey,appParameters){
var application=getApplication.call(this,appKey,appParameters);
application.routers=appRoutes[appKey];
return application;
};