Skip to content

Consistently call the second argument to useEffect dependencies array #1342

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

Closed
wants to merge 5 commits into from

Conversation

philipp-spiess
Copy link
Contributor

This PR is more thought of as a discussion starter. I was trying to find out how we refer to the second argument of the useEffect hook and it seems that we use inputs in both the API reference as well as the implementation but this name isn't used in the guide article on effects.

This made it hard for someone to explain this concept to me since she didn't know how to call it and made up a name instead. I think we should be more up-front about this name so it's easier to discuss it.

We should probably also mention it in the API signature. I've wrapped it in square brackets like we do for useImperativeMethods.

This PR is more thought of as a discussion starter. I was trying to find
out how we refer to the second argument of the `useEffect` hook and it
seems that we use `inputs` in both the API reference as well as the
implementation but this name isn't used in the guide article on effects.

This made it hard for someone to explain this concept to me since she
didn't know how to call it and made up a name instead. I think we should
be more up-front about this name so it's easier to discuss it.

We should probably also mention it in the API signature. I've wrapped it
in square brackets like we do for `useImperativeMethods`.
@philipp-spiess philipp-spiess changed the title Consistently call the second argument inputs array Consistently call the second argument to useEffect inputs array Oct 29, 2018
@acdlite
Copy link
Member

acdlite commented Oct 29, 2018

Let's call it the "dependencies" array instead? I think that's the term we agreed on.

@reactjs-bot
Copy link

reactjs-bot commented Oct 29, 2018

Deploy preview for reactjs ready!

Built with commit 5e2c5b9

https://deploy-preview-1342--reactjs.netlify.com

@philipp-spiess philipp-spiess changed the title Consistently call the second argument to useEffect inputs array Consistently call the second argument to useEffect dependencies array Oct 29, 2018
@philipp-spiess
Copy link
Contributor Author

This was superset by #1957 🙂

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

Successfully merging this pull request may close these issues.

4 participants