git.iko.soy/rowtype-yoga/purescript-yoga-react-native
on v0.1.0 help sign in
34 lines 787 B history raw
1/**
2 * @format
3 */
5import { AppRegistry, Text, View } from "react-native";
6import React from "react";
8// Register a fallback error screen first
9let startupError = null;
11function ErrorScreen() {
12 return React.createElement(
13 View,
14 { style: { flex: 1, padding: 20, backgroundColor: "#300" } },
15 React.createElement(
16 Text,
17 { style: { color: "#fff", fontSize: 16, fontWeight: "bold" } },
18 "Startup Error"
19 ),
20 React.createElement(
21 Text,
22 { style: { color: "#fcc", fontSize: 13, marginTop: 10 } },
23 String(startupError)
24 )
25 );
28try {
29 const { main } = require("./output/Main/index.js");
30 main();
31} catch (e) {
32 startupError = e.message + "\n\n" + e.stack;
33 AppRegistry.registerComponent("YogaReactExample", () => ErrorScreen);