Model the service boundary first
Keep the draft value, base version, save-operation ID, current server version, and visible status as separate state. When submitting, capture the base version and create a new operation ID. Accept a result only when its ID matches the pending operation; an older response must not overwrite a newer attempt.
React documents useReducer as a way to keep state update logic in one reducer. The important contract is not the hook: a conflict result describes one attempted write against one service version.
Keep conflict distinct from failure and completion
Use editing, saving, conflict, rebased, failed, and saved states. In a conflict, retain the draft where policy permits and request current-record context. Only after a deliberate re-review should the client adopt that current version as a new base and enter rebased; then a retry can use that reviewed version. The included model covers a current conflict, stale result, ordinary failure, refresh after conflict, and rebase-before-retry:
npm test --prefix sites/reactjsx.com/evidence/P128
It is framework-independent and does not issue a request or merge values.
Show recovery without hiding the work
Explain that the record changed before the save, retain the prepared draft where policy allows, and make review or refresh controls keyboard reachable. Illustrative JSX only—this has not been browser- or assistive-technology-tested:
{state.status === "conflict" && <p role="status">This record changed before your save. Review the current record and your draft.</p>}
W3C's status-message guidance explains that status messages can be programmatically determined without taking focus. Test the final markup with target browsers and assistive technologies.
For refresh that should not overwrite a draft, see Preserve a React Draft During a Background Refresh. For the choice after a successful mutation, see Refetch or Reconcile After a React Mutation.
Can the React form resolve the conflict itself?
No. The component can present drafts and current values. The trusted service must compare versions, enforce authorization, decide merge policy, and perform the final write.