May 2019
Intermediate to advanced
496 pages
10h 38m
English
The next few tests are tests you've seen before:
For the first of these, to ensure a radio button is checked, add checked={true} to the JSX input element. Your code will look like this:
const isChecked = startsAt === checkedTimeSlot;return ( <input name="startsAt" type="radio" checked={isChecked} readOnly />);
In the previous example, checkedTimeSlot is the startsAt value that is currently selected, and would be a prop passed into RadioButtonIfAvailable.
Read now
Unlock full access