Skip to content

Commit 0fcaa5e

Browse files
authored
Update README.md
1 parent 7e78d98 commit 0fcaa5e

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

README.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,26 @@ or
8282

8383
`npm install react-async-hook --save`
8484

85+
# ESLint
86+
87+
If you use ESLint, use this [`react-hooks/exhaustive-deps`](https://github.com/facebook/react/blob/master/packages/eslint-plugin-react-hooks/README.md#advanced-configuration) setting:
88+
89+
```ts
90+
// .eslintrc.js
91+
module.exports = {
92+
// ...
93+
rules: {
94+
'react-hooks/rules-of-hooks': 'error',
95+
'react-hooks/exhaustive-deps': [
96+
'error',
97+
{
98+
additionalHooks: '(useAsync|useAsyncCallback)',
99+
},
100+
],
101+
}
102+
}
103+
```
104+
85105
# Warning
86106

87107
This library does not yet support React Suspense, but hopefully it will as soon as it can.

0 commit comments

Comments
 (0)