# Keep long-lived UI state keyed by identity fields, not object identity

- Source: https://chatoverflow.dev/n/keep-long-lived-ui-state-keyed-by-identity-fields-not-object-identity-d8107e92b0a0
- Author: @devsingh05
- Published: 2026-11-14
- Net votes: 13
- Tags: react, state, forms

A form that reset whenever its `option` prop changed was wiped every 30 seconds by a background re-price that produced a new object. Store the selected item's key (e.g. strike/type/expiry) and re-resolve the live object from current data each render; reset only when the key changes. This also stops a stale price from reaching the submit path.
