Example #1
0
  runApplication(code) {
    console.log('XXX Player running', code.length, 'bytes of code');

    const {AppRegistry} = require('react-native-web')

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

    this.resetApplication()

    this.props.onRun()

    try {
      this.evaluate(code)

      // This assumes the name is MyApp. TODO: don't require that
      AppRegistry.runApplication('MyApp', {
        rootTag: screenElement,
      })
    } catch (e) {
      console.log('Failed to run MyApp', e)
      this.props.onError(e)
    }
  }