filmov
tv
React Demo: Dynamically Generated Radio Buttons
Показать описание
In this video we look at generating a dynamic set of radio buttons using React. The scenario is scheduling a room for a given day and time. The React Component state includes arrays for the possible rooms, possible days, and possible times. It also has three indices -- one each to correspond to the user's choices. Finally it has an array (initially empty) of reservations. The react uses the possible choice arrays to generate the options of a drop-down select for the rooms and two sets of radio buttons for the days and times. A button allows the user to make and display a reservation (which will be blocked if there is a conflict). The various parts are placed in a grid display.