heuristic
A practical rule of thumb that gives a good answer quickly in normal cases, without guaranteeing the best answer every time.
In more detail
Heuristics are used when a perfect answer would be too slow to compute. Inputs that break their assumptions give worse results.
Examples
React diffing relies on two: a change of element type means a new subtree, and matching keys mean the same item.Heuristics find unknown threats but bring false positives, so apply them after diffing against a baseline, not instead of it.Related terms
- diffing algorithm — The rules React uses to compare an old element tree with a new one and find what changed.
- key (React) — A special string or number you give to elements in a list so React can tell which item is which between renders.
- baseline — A recorded picture of what normal looks like, used as the reference for spotting changes.
- false positive — A check result that claims something is true when it is not, such as a test passing on broken code or a tool flagging correct code.
Taught in
- Keys In Depth: Identity Preservation And Identity Resetting — React 19 & Modern Component Architecture
- Diffing Algorithm: Element Type Shifts And Subtree Tear Down — React 19 & Modern Component Architecture
- Detecting Persistence: Tasks, Registry & Services — Security Operations & Threat Hunting (SOC)