ConfigsJul 28, 2026·3 min read

Reselect — Memoized Selector Library for Redux

A library for creating memoized selector functions for Redux stores. Reselect computes derived data efficiently, preventing unnecessary re-renders and keeping component logic clean.

Agent ready

Ready-to-run agent install

This asset can be installed after the agent chooses its runtime, checks the plan, and runs the matching command.

Native · 98/100Policy: allow
Agent surface
Any MCP/CLI agent
Kind
Skill
Install
Single
Trust
Trust: Established
Entrypoint
Reselect
Direct install command
npx -y tokrepo@latest install 57ebc89a-8aa2-11f1-9bc6-00163e2b0d79 --target codex

Run after dry-run confirms the install plan.

Introduction

Reselect is the official selector library for Redux that creates memoized, composable selector functions. It prevents expensive recomputation by caching results and only recalculating when relevant inputs change, which directly reduces unnecessary React re-renders.

What Reselect Does

  • Creates memoized selectors that cache their output based on input equality
  • Composes selectors from other selectors for clean derived-data pipelines
  • Integrates seamlessly with Redux and React-Redux via useSelector
  • Supports custom memoization functions and equality checks
  • Provides createStructuredSelector for mapping multiple selectors to props

Architecture Overview

Reselect selectors are pure functions composed in a dependency graph. Each selector receives one or more input selectors and a result function. The library compares current inputs to previous inputs using reference equality by default; if nothing changed, it returns the cached result. This cascading memoization means deep selector chains only recompute the parts whose dependencies actually changed.

Self-Hosting & Configuration

  • Install from npm: npm install reselect
  • Import createSelector and define input selectors pointing at state slices
  • Chain selectors by passing one selector's output as another's input
  • Use createSelectorCreator to swap in custom memoization (e.g., deep equality)
  • Pair with Redux Toolkit's createSlice for a modern Redux setup

Key Features

  • Default reference-equality memoization with zero config
  • Composable selector chains for complex derived data
  • Pluggable memoization via createSelectorCreator
  • TypeScript support with strong type inference
  • Tiny footprint with no external dependencies

Comparison with Similar Tools

  • Redux Toolkit (createSelector) — Re-exports Reselect; identical API, bundled with RTK
  • Zustand — Built-in selectors with shallow compare; no separate library needed
  • MobX — Uses reactive computed values instead of manual selectors
  • Jotai — Atom-based derived state; different paradigm from selector composition

FAQ

Q: Is Reselect still needed with Redux Toolkit? A: Redux Toolkit includes Reselect as a dependency and re-exports createSelector, so you get Reselect automatically when using RTK.

Q: How do I handle selectors that depend on component props? A: Pass a factory function to useMemo that creates a per-instance selector, or use Reselect's createSelector with explicit argument selectors.

Q: Can Reselect memoize across multiple arguments? A: Yes. Each input selector can extract a different argument. The result function receives all extracted values and the output is memoized based on all of them.

Q: Does Reselect work outside Redux? A: Yes. Reselect is a general-purpose memoized-selector library. It works with any state container or plain objects.

Sources

Discussion

Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.

Related Assets