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

Suggest improving hook API reference signatures #1825

Open
markerikson opened this issue Mar 14, 2019 · 0 comments
Open

Suggest improving hook API reference signatures #1825

markerikson opened this issue Mar 14, 2019 · 0 comments

Comments

@markerikson
Copy link
Contributor

A user on Reddit pointed out that the Hooks API Reference page section for useEffect doesn't include the deps array in the signature - it's just useEffect(callback). The deps array is only described later on under the heading "Conditionally Firing an Effect".

Similarly, the entry for useLayoutEffect() doesn't even show a signature at all - it just says "the signature is identical to useEffect".

At a minimum, the useEffect signature should show that there's an optional second argument - the deps array. It would also help to show the signature for useLayoutEffect as well.

Reddit link reference: https://www.reddit.com/r/reactjs/comments/b0oh20/usedimensions_a_react_hook_to_measure_dom_nodes/eigiqud/

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

Successfully merging a pull request may close this issue.

1 participant