This is the code in question:
useEffect(() => {
setStart(start + count);
const fetchImages = () => {
axios
.get(`/api/photos?count=${count}&start=${start}`)
.then((res) => setImages(images, ...res.data));
fetchImages();
};
}, []);
How can I use fetchImages outside of the useEffect hook?