Warning: The final argument passed to useMemo changed size between renders. The order and size of this array must remain constant

I’m getting markers when location is entered by the user, and the markers list is then provided to the Google Maps component. Since I don’t want the map to re-render everytime, I have memoized it. It only re-renders when the markers props changes. But when markers changes, I get the following warning: