I'm getting data from axios by using axios.get and saving the data in a state, and then trying to use that data in a component's prop named disabledDates so i insert the state in the prop and nothing happens but when i put the same data in a const it works
const [selected, setSelected] = useState("");
const url = "http://000.000.0.00:0000/calendar";
const [data, setData] = useState("");
useEffect(() => {
// Update the document title using the browser API
axios
.get(url)
.then((res) => setData(JSON.stringify(res.data[0].date)))
.catch((err) => {
console.error(err);
});
}, [data]);
console.log(data);
return (
<SafeAreaView style={styles.container}>
<CalendarPicker
onDateChange={(date) => setSelected(date)}
disabledDates={data}
disabledDatesTextStyle={{ color: "red" }}
/>
</SafeAreaView>
);
this is the code that contains the issue