import React, {useEffect, useState} from 'react'; import {View, Text, TouchableOpacity} from 'react-native'; import ActionSheet from 'react-native-actionsheet'; const InvalidVersionAlert = () => { const [actionSheetRef, setActionSheetRef] = useState(null); const [selected, setSelected] = useState('Select an option'); useEffect(() => { console.log('===================>Comes in version Alert'); showActionSheet(); }, []); const showActionSheet = () => { actionSheetRef.show(); }; console.log('===================>Comes in version Alert'); const handlePress = (index: number) => { const options = ['Option 1', 'Option 2', 'Option 3']; setSelected(options[index]); }; return ( setActionSheetRef(o)} title={'Select an option'} options={['Option 1', 'Option 2', 'Option 3', 'Cancel']} cancelButtonIndex={3} onPress={handlePress} /> ); }; export default InvalidVersionAlert;