Skip to content

Conversation

@msluther
Copy link
Contributor

The react-hooks rules catch lots of errors when using useMemo/useEffect/useCallback especially around the dependency arrays. e.g.

  35:6  warning  React Hook useEffect has a missing dependency: 'props'. Either include it or remove the dependency array. However, 'props' will change when *any* prop changes, so the preferred fix is to destructure the 'props' object outside of the useEffect call and refer to those specific props inside useEffect  react-hooks/exhaustive-deps
  35:6  warning  React Hook useEffect has a missing dependency: 'foo'. Either include it or remove the dependency array.   react-hooks/exhaustive-deps

But, because we would be including new rules, this should go out as a new Major release for the react* rules.

Copy link

@DullReferenceException DullReferenceException left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💯

Copy link

@twyrick-godaddy twyrick-godaddy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@DullReferenceException
Copy link

:shipit:

@rxmarbles
Copy link
Member

Will merge it now and ship later tonight

@rxmarbles rxmarbles merged commit 61e0ba9 into main Apr 16, 2021
@rxmarbles rxmarbles deleted the add-react-hooks-rules branch April 16, 2021 01:49
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 this pull request may close these issues.

10 participants