Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)
}
}
// @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'),
})
}
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
/*
const render = (rootComponent, rootTag) => {
AppRegistry.registerComponent("App", () => () => rootComponent);
AppRegistry.runApplication("App", { rootTag });
};
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') });
const render = (rootComponent, rootTag) => {
AppRegistry.registerComponent("App", () => () => rootComponent);
AppRegistry.runApplication("App", { rootTag });
};
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),
});
}
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") });