Progressive disclosure that starts simply

The on_change() function is called when the checkbox for repeating calendar entries is ticked, and it allows progressive disclosure, displaying the entire user interface for repeating calendar entries if the user opts for them. It toggles this.state.entry_being_added.repeats, which is respected by the render() function. This function displays the additional form area if the entry that is presently on the operating table has a repeats field, and it is true. If the entry does not have a repeats field, a new series is created, any time data already entered in the one-time calendar entry is copied over, and the new and (partly) blank entry is placed on the operating table:

 on_change: function() { if (this.state.entry_being_added.hasOwnProperty('repeats') ...

Get React: Building Modern Web Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.