react-hooks-js/void-use-memo
Validates that useMemos always return a value and that the result of the useMemo is used by the component/hook. See [`useMemo()` docs](https://react.dev/reference/react/useMemo) for more information.
- Category: React Compiler
- Severity: error
- Source:
eslint-plugin-react-hooks - Framework: global
- Enabled when: eslint-plugin-react-hooks v6+ installed AND React Compiler detected in project
- Documentation: https://react.dev/reference/eslint-plugin-react-hooks
Validation prompt
Use this to decide whether a fired diagnostic is real or a false positive.
Fires when a useMemo's return value is never consumed — not assigned, not destructured, not returned from the surrounding component/hook. The cached value is computed and immediately discarded, so the hook is effectively a side-effect call dressed up as memoization. False positive: rare; an unused memo is almost always a mistake.
Fix prompt
Use this once validation confirms the diagnostic is real.
Assign the result and reference it downstream (const sorted = useMemo(() => [...items].sort(), [items]); return <List items={sorted} />). If you do not need the value, you do not need the memo — delete it and either move the work to useEffect for synchronization or to an event handler for user-triggered side effects. See https://react.dev/reference/eslint-plugin-react-hooks