My code is here: https://github.com/AlonaVa/NewRestaurants
Function UpdateBounds doesn't work properly:
const [bbox, setBbox] = useState(null);
function UpdateBounds () {
const map = useMapEvent (()=>{
setBbox (map.getBounds());
}, [])
}
My question is how can I automatically update bbox with the change of the map position?
Thank you!