Don't memoize unnecessarily

This commit is contained in:
Niclas Edenvin
2024-10-31 09:40:00 +01:00
committed by Erik Tiekstra
parent fbdfeafcb5
commit eb0494c2a2

View File

@@ -50,15 +50,12 @@ export default function MobileToggleButton({
setHasMounted(true)
}, [])
const locationAndDateIsSet = useMemo(
() => parsedLocation && d,
[parsedLocation, d]
)
if (!hasMounted) {
return null
}
const locationAndDateIsSet = parsedLocation && d
const totalRooms = rooms.length
const totalAdults = rooms.reduce((acc, room) => {
if (room.adults) {