How to use the react-native-web.AppRegistry.runApplication 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-express / src / components / Player.js View on Github external
runApplication(code) {
    const {AppRegistry} = require('react-native-web')

    const screenElement = this.refs.phone.getScreenNode()

    this.resetApplication()

    this.props.onRun()

    try {
      this.evaluate(code)

      AppRegistry.runApplication('MyApp', {
        rootTag: screenElement,
      })
    } catch (e) {
      // console.log('Failed to run MyApp', e)
      this.props.onError(e)
    }
  }
github MainframeHQ / onyx / src / index.js View on Github external
// @flow

import { AppRegistry } from 'react-native-web'

import './index.css'
import Onyx from './Onyx'

document.addEventListener('dragover', event => event.preventDefault())
document.addEventListener('drop', event => event.preventDefault())

AppRegistry.registerComponent('Onyx', () => Onyx)
AppRegistry.runApplication('Onyx', {
  rootTag: document.getElementById('root'),
})
github threepointone / freezus / try / flip.js View on Github external
}

function sleep(n: number) {
  return new Promise(resolve => setTimeout(resolve, n));
}

class Display extends React.Component<{}, { screen: number }> {
  state = { screen: 0 };
  render() {
    return  } />;
  }
}

AppRegistry.registerComponent('App', () => Display);

AppRegistry.runApplication('App', {
  initialProps: {},
  rootTag: window.root,
});

// A <-> B <-> C
//
//  content
//     set to position A'
//     put that inside another

/* 
github phenomic / phenomic / examples / react-native-web-app / App.js View on Github external
const render = (rootComponent, rootTag) => {
  AppRegistry.registerComponent("App", () => () => rootComponent);
  AppRegistry.runApplication("App", { rootTag });
};
github yohamta / react-native-web-navigation-example / src / index.js View on Github external
import React from 'react';
import { AppRegistry, View, Dimensions } from 'react-native-web';
import TabRoot from './TabRoot';

const App = () => (
  
);

AppRegistry.registerComponent('App', () => App);
AppRegistry.runApplication('App', { rootTag: document.getElementById('root') });
github phenomic / phenomic / website / App.js View on Github external
const render = (rootComponent, rootTag) => {
  AppRegistry.registerComponent("App", () => () => rootComponent);
  AppRegistry.runApplication("App", { rootTag });
};
github reframejs / goldpage / plugins / react-native-web / domRender.js View on Github external
async function domRender({page, initialProps, CONTAINER_ID}) {
  const viewElement = React.createElement(page.view, initialProps);
  AppRegistry.registerComponent('App', () => () => viewElement);

  AppRegistry.runApplication('App', {
    initialProps,
    rootTag: document.getElementById(CONTAINER_ID),
  });
}
github apollographql / apollo-client-devtools / shells / dev / target / index.js View on Github external
alignContent: "stretch",
    height: "100vh",
  },
  top: {
    backgroundColor: colors.darkBlue,
    flex: 1,
    paddingTop: 20,
    paddingBottom: 40,
  },
  bottom: {
    flex: 1,
  },
});

AppRegistry.registerComponent("App", () => App);
AppRegistry.runApplication("App", { rootTag: document.getElementById("root") });