Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk4 min

Zustand vs. Redux: What the Zombie Child Problem Actually Means

A deleted record can briefly outlive a child’s props in a React-Redux update. Here’s how the zombie-child edge case works, how to reduce its risk, and what Zustand’s claim means.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If a Redux action deletes a todo while a child component still has that todo’s ID in its props, a prop-dependent selector can briefly look up a record that no longer exists. That edge case is called the zombie child problem. React-Redux documents it, but describes it as rare—not as evidence that Redux is generally broken. Zustand’s official introduction says the library addressed the pitfall, though that statement alone does not prove it is the better choice for every app.

How a deleted todo can become a zombie child

Imagine a parent renders a child for todo ID 42. The child reads the todo from the store using its ID prop. An action deletes todo 42 and also changes the parent’s data so that the parent should stop rendering that child.

As an Amazon Associate I earn from qualifying purchases.

The problem is subscription order. If the child’s store subscription runs before the parent’s update has removed the child, the child can still have its old props. Its selector then tries to read the deleted record. An unguarded lookup may fail or produce incorrect data. React-Redux describes this as a stale-props or zombie-child case when selectors depend on props. React-Redux’s hooks documentation explains the edge case.

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

Which Redux subscription model is involved?

Hooks: selectors can see stale props

React-Redux’s hooks API does not create the same nested subscription hierarchy that connect() creates. A hook-based component can therefore encounter stale props or a zombie child in some update sequences. The documentation calls these situations rare in practice, and the risk is especially relevant when a selector uses props to access an entity that may be removed.

connect(): nested subscriptions order updates

React-Redux’s connect() creates nested subscriptions through context. A connected ancestor can delay notifications to descendants until that ancestor has updated, helping ensure a child does not select against props that its parent is about to invalidate. The same documentation describes this distinction.

Redux recommends hooks as the default for components while continuing to support connect(). Using connect() immediately above a component that uses useSelector() is one documented way to restore relevant nested ordering when both are updated by the same action. React-Redux’s store-access documentation covers the supported APIs.

How to make a prop-dependent selector safer

Do not assume an entity still exists just because its ID is present in props. Read the entity first, then handle the missing case before accessing its fields.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
const todo = useSelector(state => state.todos[props.id]);
return todo ? <span>{todo.name}</span> : null;

This pattern makes deletion an expected state rather than an exceptional one. Selectors should remain pure and should not rely on thrown errors as application control flow. React-Redux notes that useSelector() attempts to handle selector errors during store updates by forcing a render, where the selector runs again; that behavior is not a substitute for a defensive lookup. See the hooks documentation and the useSelector() API guidance.

What Zustand’s claim does—and does not—establish

Zustand’s official introduction says the library spent time addressing common pitfalls including the zombie-child problem, React concurrency, and context loss between mixed renderers. That supports saying Zustand explicitly addresses this pitfall. It does not establish that every Zustand application is immune to every stale-data bug, or that Zustand is faster or safer for every workload. Zustand’s official introduction provides the stated rationale.

Question What the available documentation supports
Does React-Redux document zombie children? Yes. The hooks documentation describes stale-props and zombie-child cases involving prop-dependent selectors.
Does connect() affect subscription ordering? Yes. It creates nested subscriptions that can delay descendant notifications until an ancestor updates.
Does Zustand say it addressed the pitfall? Yes. Its introduction makes that broad claim.
Is there evidence here that Zustand always wins on performance or safety? No. The cited sources do not provide a direct benchmark or prove universal superiority.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Keep selector rerenders separate from zombie children

A selector that returns a new object on every call can cause rerenders even when the object’s fields have not changed. By default, useSelector() compares the previous and next selected values with strict === reference equality. Prefer stable selections, memoized derivations, or an appropriate equality strategy when returning composite values. This is a selector-stability concern, not the subscription-ordering bug described above. React-Redux explains equality comparisons; Redux’s selector guidance discusses derived data.

When the distinction should guide your choice

  • Choose based on your architecture, not the label “zombie child.” If using React-Redux hooks, keep prop-dependent entity lookups defensive and account for entities being deleted.
  • Consider connect() where nested ordering matters. It remains supported and provides the subscription hierarchy hooks do not.
  • Consider Zustand if its API and state model fit your app. Its introduction says it addressed this pitfall, but that claim is not a complete comparative evaluation.
  • Do not treat a render count or a rare edge case as a universal verdict. The sources establish neither a cross-library performance winner nor a categorical safety ranking.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

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

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
PC Slower Than It Used to Be?Free scan - under a minute

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.