Skip to content

Commit

Permalink
Use Vanilla JS in the New App Template
Browse files Browse the repository at this point in the history
Summary:
Flow [doesn't target OSS](https://medium.com/flow-type/clarity-on-flows-direction-and-open-source-engagement-e721a4eb4d8b), and using it in the new app template leads to a worse experience for anyone using VS Code.

Beyond that, the template package.json doesn't include `flow-bin` or a script to do typechecking.

Some two year old context here: react-native-community/discussions-and-proposals#296

This removes Flow annotations, flow config, and buck config (I don't immediately see BUCK used either) from the default template.

Changelog:
[General][Changed] - Use Vanilla JS in the App Template

Differential Revision: D40911951

fbshipit-source-id: f8a08ed0bb5be24996235c7dd9ffad01b4ad6636
  • Loading branch information
NickGerleman authored and facebook-github-bot committed Nov 1, 2022
1 parent dbb9252 commit 03825f4
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 78 deletions.
11 changes: 2 additions & 9 deletions template/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
* https://github.com/facebook/react-native
*
* @format
* @flow strict-local
*/

import React from 'react';
import type {Node} from 'react';
import {
SafeAreaView,
ScrollView,
Expand All @@ -26,12 +24,7 @@ import {
ReloadInstructions,
} from 'react-native/Libraries/NewAppScreen';

type SectionProps = {
title: string,
children: Node,
};

function Section({children, title}: SectionProps): Node {
function Section({children, title}) {
const isDarkMode = useColorScheme() === 'dark';
return (
<View style={styles.sectionContainer}>
Expand All @@ -57,7 +50,7 @@ function Section({children, title}: SectionProps): Node {
);
}

function App(): Node {
function App() {
const isDarkMode = useColorScheme() === 'dark';

const backgroundStyle = {
Expand Down
6 changes: 0 additions & 6 deletions template/_buckconfig

This file was deleted.

63 changes: 0 additions & 63 deletions template/_flowconfig

This file was deleted.

0 comments on commit 03825f4

Please sign in to comment.