I am building my first react native app and for my app to work I need to use react-native-modal-datetime-picker. here's my code-
import { StatusBar } from 'expo-status-bar';
import { StyleSheet, Text, View, FlatList, Image, Button, Pressable, ScrollView, } from 'react-native';
import React, {useState, useEffect, useCallback, Component} from 'react'
import { TextInput } from 'react-native-gesture-handler';
import RNPickerSelect from 'react-native-picker-select';
import * as ImagePicker from 'expo-image-picker';
import { FontAwesomeIcon } from '@fortawesome/react-native-fontawesome';
import { faSquare } from '@fortawesome/free-regular-svg-icons';
import * as Device from 'expo-device';
import DateTimePickerModal from 'react-native-modal-datetime-picker'
export default function Profile(props) {
const [ openD, setOpenD ] = useState(false)
const [ dob, setDob ] = useState(new Date())
const dateselect = (date) => {
setDob(date)
setOpenD(false)
}
return (
<View style={styles.scroll}>
<ScrollView style={styles.scroll}>
<Text style={styles.label}>Date of Birth:</Text>
<Pressable onPress={() => setOpenD(true)} title="date">
<Text style={styles.input}>{ dob.toLocaleDateString() }</Text>
</Pressable>
<DateTimePickerModal
isVisible={openD}
mode="date"
onConfirm={dateselect}
onCancel={() => setOpenD(false)}
/>
</ScrollView>
<StatusBar style="auto"/>
</View>
)
}
When I try to open the date picker, I get only the confirm button on the bottom and nothing else is showing up. It worked for me before and now it doesn't. I dont know how can I solve this issue?