You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It's not out of place but it could be explained better. The missing context is that this pattern of passing hooks as props is commonly done as a way to do dependency injection so you can replace the hook with a mock in testing environments. Maybe we don't need to include that, but if we want to keep it we should provide more of this context.
Yeah I was trying to think of examples where people might reach for dependency injection and testing seemed like the most common scenario. Adding some context about this would be great, @txbm would you be interested in opening a PR?
Summary
The highlighted sentence seems out of place. It does not match the context of the page.
Page
https://react.dev/reference/rules/react-calls-components-and-hooks
Details
The text was updated successfully, but these errors were encountered: