ESLintのexhaustive-depsルール

The reason the linter rule wants onChange to go into the useEffect hook is because it's possible for onChange to change between renders, and the lint rule is intended to prevent that sort of "stale data" reference.

参考

https://stackoverflow.com/questions/58866796/understanding-the-react-hooks-exhaustive-deps-lint-rule


トップ   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS