How to use the react-native-web.AppRegistry function in react-native-web

To help you get started, we’ve selected a few react-native-web examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github dabbott / react-native-web-player / components / player / Sandbox.js View on Github external
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 = `
github Beven91 / react-native-on-web / lib / apis / AppRegistry.js View on Github external
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();
}
github Beven91 / react-native-on-web / lib / apis / AppRegistry.js View on Github external
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);
};
github PaulLeCam / react-native-electron / lib / index.js View on Github external
get: function get() {
    return _reactNativeWeb.AppRegistry;
  }
});
github Beven91 / react-native-on-web / lib / apis / AppRegistry.js View on Github external
_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;
};
github Beven91 / react-native-on-web / lib / apis / AppRegistry.js View on Github external
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;
};