How to perform enabled on useQueries
Hi, I'm receiving a response body and I want to run a series of queries on that request body using useQueries. However, I can't seem to find a way to only run useQueries when the response is not undefined.
Current error. userBookings.data.bookings is undefined
1 Reply
extended-salmon•3y ago
It looks like you need to check if the bookings exist before trying to map over them. You might want to only render the component that creates these queries if you already have the bookings data or possibly default to an empty array of queries (if that's valid and works, I haven't tested it) if the bookings don't exist.