useMemo
Definition
A React hook that memoizes the result of an expensive computation, recomputing only when its dependencies change. Use it to optimize performance by avoiding unnecessary recalculations on every render.
Code Example
Jsx
Learn More
Related Terms
State
Data that a component manages internally and can change over time. When state updates, React re-renders the component. Use useState for simple state and useReducer for complex state logic.
useEffectA React hook for performing side effects in function components — fetching data, setting up subscriptions, or manually updating the DOM. Runs after every render by default; use the dependency array to control when it runs.