The strict equality operator (===) compares JavaScript values without type conversion. Primitive values match when they represent the same data; objects, arrays, and functions match only when both references identify the same object. section 3.3
React uses this referential form of strict equality when checking dependency arrays. A newly created object or array can therefore count as changed even when its contents look identical, while a stable reference does not. section 3.3 section 3.4
The comparison rules differ by value category:
- Primitives compare by represented data, so 2 === 1 + 1 evaluates to true. section 3.3
- Different object or array literals do not match: {} !== {} and [] !== []. section 3.3
- Unlike ==, === does not convert types, so "1" == 1 but strict equality requires identical types. section 3.3
Dependency identity in React
When a hook dependency array contains [id], React reruns the hook when id changes according to strict equality. An object or array dependency must retain the same reference to be considered unchanged. section 3.3



