i am trying to get an image from api and display it to screen i recieve the addrees and set it to state when i log the state it is null this is my code
useEffect(() => {
baseUrl
.get(`/api/v1/questions/${id}/edit`)
.then((response) => {
setLoading(false);
const data = response.data.data.data;
console.log(data);
setImageUrlQuestion(`https://panel.farostaha.com${data.question}`);
console.log(`https://panel.farostaha.com${data.question}`);
console.log(imageUrlQuestion);
setImageUrlAnswer(`https://panel.farostaha.com${data.answer}`);
setSelectedBookOption({ value: data.book.id, label: data.book.name });
setSelectedSubjectOption({
value: data.subject.id,
label: data.subject.name,
});
other parts works correctly but the images in the state are null