I use in my expo app rn-select-date-range : https://github.com/dilipchandima/rn-select-date-range
I use it as on the documentation :
const [selectedRange, setRange] = useState({ firstDate:'' , secondDate: '', }); ...<DateRangePicker onSelectDateRange={range => { setRange(range); hideDatePicker() }} blockSingleDateSelection={true} responseFormat="YYYY-MM-DD" maxDate={moment()} minDate={moment().subtract(100, 'days')} selectedDateContainerStyle={{ height: 35, width: '100%', alignItems: 'center', justifyContent: 'center', borderRadius: 17.5, backgroundColor: '#0C8B7D', }} font={'BeVietnam-Regular'} selectedDateStyle={{ fontWeight: 'bold', color: 'white' }} />
But ts shows me an error:
And if I make my useSate exactly like the doc:
const [selectedRange, setRange] = useState({ firstDate:'' , secondDate: '',});
I cannot access the selected values:
<Text>first date: {selectedRange.firstDate}</Text><Text>second date: {selectedRange.secondDate}</Text>
with another type error :
How to fix this error in your opinion?