react.dev icon indicating copy to clipboard operation
react.dev copied to clipboard

[Typo]: Sentence out of place?

Open txbm opened this issue 1 year ago • 3 comments
trafficstars

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

Screenshot 2024-05-18 at 6 53 15 PM

txbm avatar May 18 '24 23:05 txbm

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.

cc @poteto

rickhanlonii avatar May 19 '24 01:05 rickhanlonii

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?

poteto avatar May 20 '24 21:05 poteto

image

kjxcodez avatar Jul 11 '24 10:07 kjxcodez