From 4970f0fd730ba1d9b0d16fe8406c0d240c2f95cf Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Fri, 15 Oct 2021 14:39:00 +0800 Subject: [PATCH] =?UTF-8?q?refactor:=20=E8=B0=83=E6=95=B4=E5=85=A5?= =?UTF-8?q?=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/App.tsx | 16 ++++++---------- app/components/AppMain.tsx | 27 +++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 10 deletions(-) create mode 100644 app/components/AppMain.tsx diff --git a/app/App.tsx b/app/App.tsx index 40beff97..c08286cc 100644 --- a/app/App.tsx +++ b/app/App.tsx @@ -1,17 +1,17 @@ import { StatusBar } from 'expo-status-bar'; import React from 'react'; import { StyleSheet, View } from 'react-native'; -import { WebView } from 'react-native-webview'; -import Constants from 'expo-constants'; +import { AppMain } from './components/AppMain'; +/** + * 入口文件, 由 expo 管理 + */ export default function App() { return ( - + + ); } @@ -21,8 +21,4 @@ const styles = StyleSheet.create({ flex: 1, backgroundColor: '#fff', }, - webview: { - flex: 1, - marginTop: Constants.statusBarHeight, - }, }); diff --git a/app/components/AppMain.tsx b/app/components/AppMain.tsx new file mode 100644 index 00000000..cbeb043c --- /dev/null +++ b/app/components/AppMain.tsx @@ -0,0 +1,27 @@ +import React from 'react'; +import { StyleSheet } from 'react-native'; +import Constants from 'expo-constants'; +import { WebView } from 'react-native-webview'; + +/** + * Tailchat的主要内容 + * + * 由webview提供 + */ + +export const AppMain: React.FC = React.memo(() => { + return ( + + ); +}); +AppMain.displayName = 'AppMain'; + +const styles = StyleSheet.create({ + webview: { + flex: 1, + marginTop: Constants.statusBarHeight, + }, +});