-
Notifications
You must be signed in to change notification settings - Fork 175
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgrade to react-native@0.61-rc.3 (from 0.59.0)
- Loading branch information
1 parent
23db949
commit d67d730
Showing
49 changed files
with
5,506 additions
and
6,313 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,95 @@ | ||
import React from 'react' | ||
import { Platform, StyleSheet, Text, View } from 'react-native' | ||
import React from 'react'; | ||
import { | ||
SafeAreaView, | ||
ScrollView, | ||
StatusBar, | ||
StyleSheet, | ||
Text, | ||
View, | ||
} from 'react-native'; | ||
|
||
const instructions = Platform.select({ | ||
ios: 'Press Cmd+R to reload,\n' + 'Cmd+D or shake for dev menu', | ||
android: | ||
'Double tap R on your keyboard to reload,\n' + | ||
'Shake or press menu button for dev menu', | ||
}) | ||
import { AppHeader } from './AppHeader' | ||
|
||
export interface AppProps {} | ||
|
||
export function App(_props: AppProps) { | ||
export function App() { | ||
return ( | ||
<View style={styles.container}> | ||
<Text style={styles.welcome}> | ||
Welcome to react-native-web + monorepo! | ||
</Text> | ||
<Text style={styles.instructions}> | ||
This component is being shared between iOS, Android & Web. | ||
</Text> | ||
<Text style={styles.instructions}>{instructions}</Text> | ||
</View> | ||
) | ||
} | ||
<> | ||
<StatusBar barStyle="dark-content" /> | ||
<SafeAreaView> | ||
<ScrollView | ||
contentInsetAdjustmentBehavior="automatic" | ||
style={styles.scrollView}> | ||
<AppHeader /> | ||
{global.HermesInternal == null ? null : ( | ||
<View style={styles.engine}> | ||
<Text style={styles.footer}>Engine: Hermes</Text> | ||
</View> | ||
)} | ||
<View style={styles.body}> | ||
<View style={styles.sectionContainer}> | ||
<Text style={styles.sectionTitle}>Code sharing using Monorepo</Text> | ||
<Text style={styles.sectionDescription}> | ||
Edit <Text style={styles.highlight}>packages/components/App.tsx</Text> to change this | ||
screen and then come back to see your edits (in the phone or the browser). | ||
</Text> | ||
</View> | ||
<View style={styles.sectionContainer}> | ||
<Text style={styles.sectionTitle}>Web support via react-native-web</Text> | ||
<Text style={styles.sectionDescription}> | ||
Run <Text style={styles.highlight}>yarn workspace web start</Text> to | ||
open this app in the browser. | ||
</Text> | ||
<Text style={styles.sectionDescription}> | ||
It will share the same code from mobile, unless you create platform-specific files | ||
using the <Text style={styles.highlight}>.web.tsx</Text> extension | ||
(also supports <Text style={styles.highlight}>.android</Text>,{' '} | ||
<Text style={styles.highlight}>.ios</Text>,{' '} | ||
<Text style={styles.highlight}>.native</Text>, etc). | ||
</Text> | ||
</View> | ||
</View> | ||
</ScrollView> | ||
</SafeAreaView> | ||
</> | ||
); | ||
}; | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
flex: 1, | ||
justifyContent: 'center', | ||
alignItems: 'center', | ||
backgroundColor: '#F5FCFF', | ||
}, | ||
welcome: { | ||
fontSize: 20, | ||
textAlign: 'center', | ||
margin: 10, | ||
}, | ||
instructions: { | ||
textAlign: 'center', | ||
color: '#333333', | ||
marginBottom: 5, | ||
}, | ||
}) | ||
scrollView: { | ||
backgroundColor: 'white', | ||
}, | ||
engine: { | ||
position: 'absolute', | ||
right: 0, | ||
}, | ||
body: { | ||
backgroundColor: 'white', | ||
}, | ||
sectionContainer: { | ||
marginTop: 32, | ||
paddingHorizontal: 24, | ||
}, | ||
sectionTitle: { | ||
fontSize: 24, | ||
fontWeight: '600', | ||
color: 'black', | ||
}, | ||
sectionDescription: { | ||
marginTop: 8, | ||
fontSize: 18, | ||
fontWeight: '400', | ||
color: 'gray', | ||
}, | ||
highlight: { | ||
fontWeight: '700', | ||
}, | ||
footer: { | ||
color: 'gray', | ||
fontSize: 12, | ||
fontWeight: '600', | ||
padding: 4, | ||
paddingRight: 12, | ||
textAlign: 'right', | ||
}, | ||
}); | ||
|
||
declare var global: any |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
import { | ||
Header as AppHeader | ||
} from 'react-native/Libraries/NewAppScreen'; | ||
|
||
export { AppHeader } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React from 'react' | ||
import { StyleSheet, Text, View } from 'react-native' | ||
|
||
export function AppHeader() { | ||
return <View style={styles.container}> | ||
<Text style={styles.text}>Welcome to React Native Web + Monorepo</Text> | ||
</View> | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
width: '100%', | ||
height: 200, | ||
backgroundColor: '#f3f3f3', | ||
}, | ||
text: { | ||
fontSize: 36, | ||
fontWeight: '600', | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
module.exports = { | ||
root: true, | ||
extends: '@react-native-community', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.