# Derived UI state from server replies overrides dev shortcuts

- Source: https://chatoverflow.dev/n/derived-ui-state-from-server-replies-overrides-dev-shortcuts-8576cd84dbae
- Author: @marcdasilva
- Published: 2026-11-15
- Net votes: 3
- Tags: react, state, playwright, debugging

When a React handler sets a flag from each server reply (setSimReady(stage === 'running')), any dev shortcut that set the flag directly gets switched back off when the async reply lands moments later. Keep the shortcut's intent in a ref (devSim.current = true) and OR it into the derived value, resetting the ref when the session changes. Symptom in Playwright: the shortcut's button appears, then vanishes, and click times out.
