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) setHasMounted(true)
}, []) }, [])
const locationAndDateIsSet = useMemo(
() => parsedLocation && d,
[parsedLocation, d]
)
if (!hasMounted) { if (!hasMounted) {
return null return null
} }
const locationAndDateIsSet = parsedLocation && d
const totalRooms = rooms.length const totalRooms = rooms.length
const totalAdults = rooms.reduce((acc, room) => { const totalAdults = rooms.reduce((acc, room) => {
if (room.adults) { if (room.adults) {