diff --git a/template/App.js b/template/App.js index 4c97733b30c..885fef81169 100644 --- a/template/App.js +++ b/template/App.js @@ -26,9 +26,31 @@ import { ReloadInstructions, } from 'react-native/Libraries/NewAppScreen'; -/* $FlowFixMe[missing-local-annot] The type annotation(s) required by Flow's - * LTI update could not be added via codemod */ -const Section = ({children, title}): Node => { +const styles = StyleSheet.create({ + sectionContainer: { + marginTop: 32, + paddingHorizontal: 24, + }, + sectionTitle: { + fontSize: 24, + fontWeight: '600', + }, + sectionDescription: { + marginTop: 8, + fontSize: 18, + fontWeight: '400', + }, + highlight: { + fontWeight: '700', + }, +}); + +type SectionProps = { + title: string, + children: Node, +}; + +function Section({children, title}: SectionProps): Node { const isDarkMode = useColorScheme() === 'dark'; return ( @@ -52,9 +74,9 @@ const Section = ({children, title}): Node => { ); -}; +} -const App: () => Node = () => { +export default function App(): Node { const isDarkMode = useColorScheme() === 'dark'; const backgroundStyle = { @@ -93,25 +115,4 @@ const App: () => Node = () => { ); -}; - -const styles = StyleSheet.create({ - sectionContainer: { - marginTop: 32, - paddingHorizontal: 24, - }, - sectionTitle: { - fontSize: 24, - fontWeight: '600', - }, - sectionDescription: { - marginTop: 8, - fontSize: 18, - fontWeight: '400', - }, - highlight: { - fontWeight: '700', - }, -}); - -export default App; +}