This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import { useMemo } from "react"; | |
| /** | |
| * useMemo – When and Why to Use It | |
| * | |
| * ✅ Use useMemo when: | |
| * - You have an expensive calculation (loops, reduce, filter on large arrays) | |
| * - The result is derived from props or state | |
| * - The calculation should not re-run on every re-render | |
| * |