The Git tag for this section is load-available-time-slots. It contains solutions to the exercises from the previous chapter, so if you haven't completed the Exercises section yourself, then you should move to this tag now so that you're up to date.
For more detailed instructions, see the To get the most out of this book section in the Preface.
For more detailed instructions, see the To get the most out of this book section in the Preface.
When we built our AppointmentForm component, we passed in availableTimeSlots as a prop. We passed sample data to check that our form was displaying those time slots correctly.
Our server offers an endpoint that returns us this week's available time slots:
GET /availableTimeSlots
In this section, we'll make a fetch request to the endpoint when our application first loads. As we saw in the previous chapter, each time we use fetch to pull data, we need at least two tests: one to check...