One module contains a pure functional implementation of the actual robot / program execution logic. It exposes two functions: one that takes a level description and returns an initial game state, and one that takes the level description and a game state and produces a new game state.
The next module contains a Flux store (just something that holds data) which holds the level descriptions, the current game state, and can run a timer. If you tell the store to start, it starts the timer, runs the robot logic every tick, and emits an event when its data changes. (It also handles a whole bunch of other state, but that’s irrelevant for this description.)
Then there is a React component for the robot (obviously one of many components). React components are, ideally, pure functions of their inputs. They’re best written declaratively: you use React to declare what you want the user interface to be like. This usually works like a charm.
But game logic can be hard to fit into this model.