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

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

Imagine a Redux action deletes a todo while its child component still has the todo’s ID in its props. If that child’s store subscription runs before its parent updates and removes it, a selector such as state.todos[props.id].name can try to read a record that no longer exists. That subscription-ordering edge case is the zombie child problem. It is documented, but it is not evidence that Redux is generally broken—or that Zustand wins every comparison.

How a deleted record can leave a child with stale props

The issue depends on timing and component relationships. A child subscribes to the store, and its selector uses a prop—often an entity ID—to look up data. An action removes that entity. The parent’s next update would stop rendering the child, but the child’s subscription may run first, while the child still has its old props.

If the selector assumes the record exists, accessing a property such as name can fail. React-Redux documents this as a possible stale-props or zombie-child case for selectors that depend on props; it is an edge case, not a claim that every Redux component is exposed. React-Redux’s hooks documentation explains the conditions and mitigation options.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

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

How to prevent unsafe lookups

Check that the entity still exists

Make the selector handle deletion before accessing a field. For example:

const todo = useSelector(state => state.todos[props.id]);
return todo ? <span>{todo.name}</span> : null;

This example is illustrative: the important step is checking the lookup result before reading a property. Selectors should remain pure, and application behavior should not depend on a selector throwing. React-Redux notes that useSelector() attempts to handle selector errors during store updates by forcing a render, when the selector runs again; that is not a substitute for a safe lookup. See the documented guidance.

Use a connected ancestor when subscription ordering matters

When a connected ancestor and a hook-based descendant update from the same action, placing a component using connect() immediately above the hook-using component can restore the relevant nested subscription ordering. React-Redux’s documentation describes this as a mitigation for the edge case.

Why hooks and connect differ

React-Redux’s connect() API creates nested subscriptions through context, allowing a connected ancestor to update before descendant notifications are delivered. The hooks API cannot establish that same nested provider hierarchy, so stale-props and zombie-child cases may occur with hooks when selectors use props. The documentation characterizes these issues as rare.

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

Redux recommends hooks as the default for components while continuing to support connect(). The practical choice is therefore not “safe Redux versus unsafe Redux”: use defensive selectors, and consider the component subscription structure when a child’s lookup depends on an entity that can disappear. See the React-Redux hooks documentation and the Redux selector guidance.

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

Zustand’s official introduction says the library addressed common pitfalls including the zombie-child problem, React concurrency, and context loss between mixed renderers. That is a meaningful point in its favor if you are choosing a state library and want an approach whose introduction explicitly addresses these pitfalls. The claim appears in Zustand’s introduction.

It does not establish that Zustand is faster, safer in every workload, or categorically better than Redux. The cited introduction is not a comparative benchmark, and it does not provide detailed comparative selector guidance. Choose based on the APIs and state patterns your application needs; do not treat the zombie-child claim alone as proof of a universal winner.

Keep selector rerenders separate from the zombie-child bug

There is another selector concern that can look like a performance problem but has a different cause. React-Redux’s useSelector() subscribes to the store and compares the previous and current selected values using strict === equality by default. A selector that returns a newly created object can therefore trigger a rerender even when the object’s fields are equivalent. Stable results, memoized derivations, or an appropriate equality strategy can address that behavior; it is not the zombie-child subscription-ordering problem.

Free tools Windows power users keep installed

One-click scans. No signup required.

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

Redux’s equality-comparison guidance and selector guidance cover these separate concerns. Selectors may run during rendering and in response to store updates, so keep them pure.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How to decide between Zustand and Redux

  • For either library: guard entity lookups when an entity can be removed while a component still holds its ID in props.
  • For React-Redux hooks: account for the documented stale-props edge case in prop-dependent selectors; use connect() where its nested subscription ordering is useful.
  • For selector performance: avoid returning a fresh object unnecessarily or use memoization or an appropriate equality strategy.
  • For Zustand: count its documented attention to the pitfall as a stated design consideration, not as comparative proof of superiority.

If your reason for preferring Zustand is specifically the zombie-child problem, the evidence supports saying it explicitly addresses the pitfall. If you need a verdict on overall performance or ecosystem fit, that requires criteria and comparative evidence beyond this issue.

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.