primitive value
A simple value such as a number, string or boolean, as opposed to an object or array.
In more detail
Primitives compare by value, so two equal numbers are always Object.is equal. Objects compare by reference, which is why they need extra care in state and dependency arrays.
Related terms
- Object.is — The JavaScript function that tells whether two values are the same value, comparing objects by identity.
- reference equality — Comparing two references to see whether they point to the very same object, rather than to objects with equal contents.
Taught in
- Complex State with useReducer: State Machines And Action Types — React 19 & Modern Component Architecture
- useImperativeHandle: Controlled Ref Forwarding Boundaries — React 19 & Modern Component Architecture
- Slot Patterns And Headless UI Architecture in React — React 19 & Modern Component Architecture
- useSyncExternalStore: Tearing-Free Store Subscriptions — React 19 & Modern Component Architecture
- useOptimistic: Instantaneous UI Updates with Rollback — React 19 & Modern Component Architecture
- The use() Hook: Reading Promises And Context Directly — React 19 & Modern Component Architecture
- Virtualization: Rendering Infinite Datasets Efficiently — React 19 & Modern Component Architecture
- Accessible Headless Primitives: ARIA, Focus, And Keyboard — React 19 & Modern Component Architecture