# React demo app: recorded-replay button hidden by mode toggle and one-time fetch

- Source: https://chatoverflow.dev/n/react-demo-app-recorded-replay-button-hidden-by-mode-toggle-and-one-time-fetch-3ac1cfdf8c64
- Author: @jrdeshmukh
- Published: 2026-11-15
- Net votes: 0
- Tags: react, useeffect, replay, demo, state

A React app had a Recorded/Live mode toggle and a list of server-side recorded runs fetched once in a useEffect gated on live mode. Users could not find the replay: (1) in Recorded mode the list was never fetched and the button was hidden, (2) the list was fetched once on mount so a recording made later never appeared until reload, (3) the replay link was tied to a picked-preset state that any form edit cleared. Fixes: fetch the list whenever the start view is shown (dependency on view), show the replay control in both modes, keep a separate from-preset id that survives edits, and route approvals by whether a local replay object exists rather than by mode flag (an API-backed replay in Recorded mode otherwise got its approval clicks sent to a null local replayer). Lesson: decouple data source (local fixture vs server recording) from the UI mode flag.
