Activity modals
In this final section of this chapter, you'll implement a modal that shows a progress indicator. The idea is to display the modal and then hide it when the promise resolves. Here's the code for the generic Activity
component, which shows a modal with ActivityIndicator
:
import React from "react"; import { View, Modal, ActivityIndicator } from "react-native"; import styles from "./styles"; export default function Activity(props) { return ( <Modal visible={props.visible} transparent> <View style={styles.modalContainer}> <ActivityIndicator size={props.size} /> </View> </Modal> ); } Activity.defaultProps = { visible: false, size: "large", };
You might be tempted...