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
type ActionHandler = (...args: any[]) => Promise<(() => void) | undefined | void>; | |
// Hook used to initiate loading on action started and finish loading on action completed | |
const useLoading = (action: ActionHandler, timeout = 0): [ActionHandler, boolean] => { | |
const [loading, setLoading] = useState(false); | |
const isMounted = useRef(false); | |
useEffect(() => { | |
isMounted.current = true; |
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 { View, StyleSheet, Pressable } from "react-native"; | |
import { Dispatch, ReactElement, ReactNode, SetStateAction } from "react"; | |
const Popover = ({ | |
visible, | |
setVisible, | |
children, | |
PopoverContent, | |
}: { | |
visible: boolean; |