concept isPresenting in category react

This is an excerpt from Manning's book React Hooks in Action.
To model Presentation Mode for the
BookablesListcomponent, we add an extra state value for the reducer calledisPresenting. We check thatisPresentingistruebefore firing up any timers for Presentation Mode. The initial value ofisPresentingisfalsebut switches totruewhen the bookables load. Then, if the user selects a bookable or uses the Next button, the value switches back tofalse.Switching off Presentation Mode when the user directly selects a bookable is easy to handle, just set
isPresentingtofalsein theSET_BOOKABLEaction. But, both a timer (in Presentation Mode) and the user (by clicking the Next button) can cause the movement from one bookable to the next, by dispatching theNEXT_BOOKABLEaction. So, theNEXT_BOOKABLEaction needs to know whether it’s a timer or a user dispatching it; it needs to know whether to stop presenting or not. You can see the reducer using theNEXT_BOOKABLEaction’s payload to setisPresentingin listing 6.2.