Skip to content

Commit d0056dc

Browse files
committed
fix: remove old boilerplate code for simple screen
1 parent bcb0d97 commit d0056dc

File tree

15 files changed

+26
-587
lines changed

15 files changed

+26
-587
lines changed

src/__tests__/index.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
import "react-native";
2+
import React from "react";
3+
import { Main } from "..";
4+
import renderer from "react-test-renderer";
5+
6+
it("renders correctly", () => {
7+
renderer.create(<Main />);
8+
});

src/components/Instructions/__tests__/__snapshots__/index.tsx.snap

Lines changed: 0 additions & 39 deletions
This file was deleted.

src/components/Instructions/__tests__/index.tsx

Lines changed: 0 additions & 10 deletions
This file was deleted.

src/components/Instructions/index.tsx

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/components/Welcome/__tests__/__snapshots__/index.tsx.snap

Lines changed: 0 additions & 133 deletions
This file was deleted.

src/components/Welcome/__tests__/index.tsx

Lines changed: 0 additions & 41 deletions
This file was deleted.

src/components/Welcome/index.tsx

Lines changed: 0 additions & 80 deletions
This file was deleted.

src/components/index.tsx

Lines changed: 0 additions & 2 deletions
This file was deleted.

src/index.tsx

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,22 @@
1-
// app entry
2-
import { AppRegistry, Platform } from "react-native";
3-
import { App } from "./screens";
4-
import { Config } from "./utils";
1+
import React, { memo } from "react";
2+
import { AppRegistry, View, Text, Platform, StyleSheet } from "react-native";
53

6-
// register the app
7-
AppRegistry.registerComponent(Config.app.name, () => App);
4+
const appName = "example";
5+
const styles = StyleSheet.create({
6+
container: { flex: 1, justifyContent: "center", alignItems: "center" }
7+
});
88

9-
// register the web
10-
if (Platform.OS === Config.os.web) {
11-
AppRegistry.runApplication(Config.app.name, {
12-
rootTag: document.getElementById(Config.web.root)
9+
export const Main = memo(function Main() {
10+
return (
11+
<View style={styles.container}>
12+
<Text>react native with web and typecript</Text>
13+
</View>
14+
);
15+
});
16+
17+
AppRegistry.registerComponent(appName, () => Main);
18+
if (Platform.OS === "web") {
19+
AppRegistry.runApplication(appName, {
20+
rootTag: document.getElementById("root")
1321
});
1422
}

0 commit comments

Comments
 (0)