MCPcopy Create free account
hub / github.com/dabbott/react-native-express / App

Function App

examples/files/exercises/PhotoGallery2.js:8–33  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

6import PhotoGrid from './components/PhotoGrid'
7
8export default function App() {
9 const [state, dispatch] = useReducer(reducer, initialState)
10
11 const { photos, nextPage, loading, error } = state
12
13 // We'll show an error only if the first page fails to load
14 if (photos.length === 0) {
15 if (loading) {
16 return (
17 <View style={styles.container}>
18 <ActivityIndicator animating={true} />
19 </View>
20 )
21 }
22
23 if (error) {
24 return (
25 <View style={styles.container}>
26 <Text>Failed to load photos!</Text>
27 </View>
28 )
29 }
30 }
31
32 return <PhotoGrid numColumns={3} photos={photos} />
33}
34
35const styles = StyleSheet.create({
36 container: {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected