Skip to content
Advertisement

IF/ELSE condition not working properly and Rerendring duplicates React

My goal here is to check a checkin and checkout date and see if a room is available or not

if availdata[p.roomId][date].i==0 then the room at that range of dates is not available so it will be displayed as not available

if not it will check its price with availdata[p.roomId][date].p1 and display it with a price instead

JavaScript

in my case it’s displaying each room 4 times with same price image

Advertisement

Answer

Update : solution is

JavaScript
Advertisement