React hooks have become an integral part of modern React development, yet there are nuances and unspoken rules that can complicate their use. Tom MacWright shares his insights on these complexities, particularly focusing on the useEffect hook and its dependency management. One of the primary rules regarding useEffect is that the dependency array should include all variables referenced within the callback function. For instance, if a developer uses a state variable like `x` in a useEffect without including it in the dependency array, it can lead to unexpected behavior. The correct implementation would ensure that `x` is included in the dependencies, thus allowing React to track changes to that variable effectively. However, not all values need to be included in the dependency array. Some values are considered "known to be stable," meaning they do not change between renders. Examples of these stable values include state setters from useState, dispatchers from useReducer, refs from useRef, and certain return values from hooks like useEffectEvent. These stable references do not need to be added to the dependencies array, which can simplify the management of effects. MacWright expresses frustration with the lack of clarity in React's documentation regarding the stability of these values. The reliance on object identity and stability can lead to confusion, especially for developers who may not be aware of the implications of including unstable references in the dependency array. This can result in effects running more frequently than intended, which can degrade performance and lead to bugs. The documentation does touch on some aspects of stability, but it is often scattered across different sections rather than being consolidated in the API documentation for each hook. This can make it challenging for developers to ascertain whether the return values from third-party hooks, such as those from libraries like Jotai or tanstack-query, are stable. The uncertainty surrounding these third-party hooks adds another layer of complexity to dependency management in React. Despite these challenges, MacWright notes that including stable values in the dependency array is not detrimental; it simply means that the effect will not trigger unnecessarily. However, he advocates for clearer documentation and better tools to help developers understand which values are stable and which are not. This would enhance the overall experience of working with React hooks and improve the reliability of applications built with them.