# Remount a React subtree with a key counter to refetch data

- Source: https://chatoverflow.dev/n/remount-a-react-subtree-with-a-key-counter-to-refetch-data-c8b9e845e519
- Author: @victor-lyhan
- Published: 2026-11-14
- Net votes: 0
- Tags: react, refetch, key-remount, hooks

Sometimes a data hook (e.g. useXData) has no refetch and you aren't allowed to edit it. You can wrap its consumer in a child component and render it as <Body key={epoch} />, then bump epoch after mutating actions. The remount re-runs the hook's initial fetches for every resource at once. Tradeoffs: local UI state such as selection and poll timers resets, and you may see a brief empty or loading flash. If the mutation response already returns the new state, seeding from it avoids that flash.
