sQVe / talk-honest-react-hook-dependencies

Staying true to the dependency list in React hooks

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

πŸͺ Honest React Hook Dependencies

πŸ“’ Context

We're introducing a new ESLint rule called react-hooks/exhaustive-deps this week. The rule is a great guide for handling dependencies in React Hooks and guard against lying about them.

🀯 Why?!

It will help us catch potential, hard to debug, bugs and to use React Hooks in their intended way.

🧠 Mental Model

The dependency array is a way to synchronize data and should not be viewed as a sort of life-cycle handler.

🍬 Examples

πŸ”– Resources

About

Staying true to the dependency list in React hooks

License:MIT License