October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsPC HealthRecommendedCrashes, freezes, slowdowns? Check your PC nowSpot repairable issues before they interrupt work.Check PCOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

React Re-render vs. Remount: What Triggers Each?

A re-render recalculates UI; a remount creates a new component instance. Learn how state, props, keys, and component types determine which occurs.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A React re-render runs component code again to calculate the next UI; it does not necessarily recreate the component or change the DOM. A remount happens when React treats the next tree as a different component instance—usually because the old one was removed or replaced, its type changed, or its key changed. Re-renders can preserve local state; remounts initialize it again.

What is the difference between a re-render and a remount?

Rendering and changing the browser DOM are separate steps. During render, React calls components to work out what the UI should look like. During commit, it applies the DOM changes that are actually needed. A component can therefore render again while its existing DOM remains in place. React’s Render and Commit guide describes the rendering stage and its relationship to the DOM.

A remount is the practical term for React discarding a component instance and creating a new one. The new instance starts with fresh local state, and effects associated with the previous instance are cleaned up before effects for the new instance are set up. A render log alone cannot tell you that this happened.

What triggers a re-render?

React’s official guide identifies two reasons a component renders: its initial render, or an update to state in that component or one of its ancestors. Context updates can also cause a component that reads that context to render.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Initial render: React calls the components needed to produce the initial UI.
  • State update: A state setter queues an update. React calls the relevant component and evaluates the returned UI as needed.
  • Context update: A consumer may render when the context value it uses changes.

memo can let React skip rendering a component when its props have not changed, but it is a performance optimization, not a guarantee that the component will never render. Its own state and context updates can still cause a render. See React’s memo reference.

Rendering should be pure: calculate the UI without performing side effects or mutating existing inputs. In development, Strict Mode may call component functions more than once to help reveal impure rendering. Extra calls in that setting do not, by themselves, mean React mounted the component again.

What triggers a remount or state reset?

React preserves state when it can match a component in the new UI tree to the same component at the same position, with the same type and key. React’s Preserving and Resetting State guide explains this identity rule. If the match fails, React discards the old instance rather than carrying its local state forward.

  • The component is removed: If a conditional branch stops rendering it, its state is discarded. Rendering it again later creates a fresh instance.
  • A different type replaces it: Replacing one component type with another—or a component with a host element such as <div>—at the same position replaces the old subtree.
  • Its key changes: A changed key tells React this is a different identity, even if the component type and apparent position are unchanged. Keys are interpreted within their parent.
  • The component function is defined inside another component: Each render creates a new function identity. React can treat that function as a different component type, resetting its state and the state below it. Define component functions at module scope instead.

By contrast, changing a prop normally passes new data to the existing instance; it does not remount the component. For more on why component types matter, see React calls Components and Hooks.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How do keys affect state when items move?

Keys help React match sibling components across renders. If a list is reordered, stable keys let React associate each component—and its state—with the intended item. Without stable keys, React may associate state according to sibling position instead, which can make state appear to move to the wrong item. Choose a key from a stable identifier for the entity, not from a value that changes on every render.

A key can also deliberately reset state outside a list. For example, if a chat view should start with an empty draft whenever the recipient changes, key the view by recipient identity. React documents that changing a key can reset a component tree’s state in the useState reference. If the same logical counter merely receives a new label, keeping its type, position, and key lets its state persist.

How can you tell whether a component actually remounted?

  1. Log renders separately. A log in the component body tells you it ran; it does not establish that the instance is new.
  2. Log effect setup and cleanup. A useEffect setup/cleanup pair, or class lifecycle methods, can help identify instance lifecycle changes. Interpret development logs carefully: Strict Mode may run extra checks.
  3. Inspect conditional branches. Check whether the component disappears or another type is rendered in its place.
  4. Inspect keys. Verify that the key stays stable for the entity whose state should persist. Avoid random keys or keys that change on each render.
  5. Check component declarations. Move any child component function declared inside a rendering component to module scope.
  6. Decide what owns the state. If state belongs to a record or recipient, use stable identity deliberately; if it belongs to a continuing visual slot, preserve the same component identity.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.