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
const DATA = [ | |
{ | |
text: "man", | |
image: require('./assets/images/photo1.jpg') | |
}, | |
{ | |
text: "woman", | |
image: require('./assets/images/photo2.jpg') | |
} | |
] |
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
import * as FileSystem from 'expo-file-system'; | |
<Button | |
onPress={() => { | |
let dirToRead = FileSystem.documentDirectory; | |
console.log('Reading :' + dirToRead); | |
FileSystem.readDirectoryAsync('file://' + dirToRead) | |
.then((dir) => { | |
dir.forEach((val) => { |
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
import * as FileSystem from 'expo-file-system'; | |
import {Image} from 'react-native'; | |
const foo = require('./assets/images/photo1.jpg'); | |
const fooURI = Image.resolveAssetSource(foo).uri; | |
<Button | |
onPress={() => { | |
let docDir = FileSystem.documentDirectory; | |
let localFile = 'file://' + docDir + 'photo1.jpg'; |
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
import * as FileSystem from 'expo-file-system'; | |
const foo = require('./assets/images/photo1.jpg'); | |
const fooURI = Image.resolveAssetSource(foo).uri; | |
console.log('FooURI: ' + fooURI); | |
const App: () => React$Node = () => { | |
const [imageDownloaded, setImageDownloaded] = useState(0); | |
const docDir = FileSystem.documentDirectory; | |
const localFile = 'file://' + docDir + 'photo1.jpg'; |
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
import 'react-native-gesture-handler'; | |
import React from 'react'; | |
import {NavigationContainer} from '@react-navigation/native'; | |
import {SafeAreaView, ScrollView, View, Text, StatusBar} from 'react-native'; | |
const App: () => React$Node = () => { | |
return ( | |
<> |
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
const ScreenOne = () => { | |
return ( | |
<View> | |
<Text> Screen One </Text> | |
</View> | |
); | |
}; | |
const ScreenTwo = () => { | |
return ( |
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
import 'react-native-gesture-handler'; | |
import React from 'react'; | |
import {NavigationContainer} from '@react-navigation/native'; | |
import {SafeAreaView, ScrollView, View, Text, StatusBar} from 'react-native'; | |
const ScreenOne = () => { | |
return ( | |
<View> | |
<Text> Screen One </Text> |
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
const ScreenOne = ( {navigation} ) => { | |
return ( | |
<View> | |
<Text> Screen One </Text> | |
<Button | |
title="Go to Two" | |
onPress={() => navigation.navigate('Two')} | |
/> | |
</View> | |
); |
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
useEffect(() => { | |
console.log('Screen 1 Mount: '); | |
console.log(navigation.dangerouslyGetState()); | |
return () => { | |
console.log('Screen 1 Unmount:'); | |
console.log(navigation.dangerouslyGetState()); | |
}; | |
}); |
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
const Drawer = createDrawerNavigator(); | |
const DrawerScreens = () => { | |
return ( | |
<Drawer.Navigator> | |
<Drawer.Screen name="One" component={ScreenOne} /> | |
<Drawer.Screen name="Two" component={ScreenTwo} /> | |
<Drawer.Screen name="Three" component={ScreenThree} /> | |
</Drawer.Navigator> | |
); | |
}; |
OlderNewer