What happens if you subscribe to the entire state object in a component (e.g., `const state = useStore()`)?
React JS interview question for Advanced practice.
Answer
The component will re-render whenever any property in the entire store changes.
Explanation
If your selector returns the entire state object, the component effectively subscribes to all changes. Any update to any property within the store will cause the selector to return a new state object, triggering a re-render in the component. This negates Zustand's primary performance benefit of selective re-rendering.