From 715872764bc83437e72dbaf9a448d1f9c78674ca Mon Sep 17 00:00:00 2001 From: Radek Czemerys Date: Tue, 16 Mar 2021 20:52:17 +0000 Subject: [PATCH 1/2] fix: App.tsx closes #195 --- template/App.tsx | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/template/App.tsx b/template/App.tsx index 91251e24..f67b137c 100644 --- a/template/App.tsx +++ b/template/App.tsx @@ -9,7 +9,6 @@ */ import React from 'react'; - import type {Node} from 'react'; import { SafeAreaView, ScrollView, @@ -28,7 +27,13 @@ ReloadInstructions, } from 'react-native/Libraries/NewAppScreen'; - const Section = ({children, title}): Node => { + const Section = ({ + children, + title, + }: { + children: React.ReactNode; + title: string; + }) => { const isDarkMode = useColorScheme() === 'dark'; return ( @@ -54,7 +59,7 @@ ); }; - const App: () => Node = () => { + const App = () => { const isDarkMode = useColorScheme() === 'dark'; const backgroundStyle = { From 0c3d548ddb3633f542804c5818076edb86d5005a Mon Sep 17 00:00:00 2001 From: Radek Czemerys Date: Wed, 17 Mar 2021 17:18:04 +0000 Subject: [PATCH 2/2] fix: use React.FC --- template/App.tsx | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/template/App.tsx b/template/App.tsx index f67b137c..5b9974c9 100644 --- a/template/App.tsx +++ b/template/App.tsx @@ -27,13 +27,9 @@ ReloadInstructions, } from 'react-native/Libraries/NewAppScreen'; - const Section = ({ - children, - title, - }: { - children: React.ReactNode; + const Section: React.FC<{ title: string; - }) => { + }> = ({children, title}) => { const isDarkMode = useColorScheme() === 'dark'; return (