Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Typo]: Sentence out of place? #6881

Open
txbm opened this issue May 18, 2024 · 3 comments
Open

[Typo]: Sentence out of place? #6881

txbm opened this issue May 18, 2024 · 3 comments
Assignees

Comments

@txbm
Copy link

txbm commented May 18, 2024

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

@rickhanlonii
Copy link
Member

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

@poteto
Copy link
Member

poteto commented May 20, 2024

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?

@CuriousCoder00
Copy link

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants