diff --git a/src/components/ImageBanner.jsx b/src/components/ImageBanner.jsx index 2d40c712..c881185f 100644 --- a/src/components/ImageBanner.jsx +++ b/src/components/ImageBanner.jsx @@ -1,15 +1,17 @@ import React, { useState, useEffect } from 'react'; +import { useLocation } from 'react-router-dom'; const ImageBanner = () => { const [currentImage, setCurrentImage] = useState(1); + const location = useLocation(); useEffect(() => { setCurrentImage(Math.floor(Math.random() * 13) + 1); - }, []); + }, [location.key]); return ( ); }; -export default ImageBanner; \ No newline at end of file +export default ImageBanner;