@arthurgeron/eslint-plugin-react-usememo
Advanced tools
Comparing version 1.0.0 to 1.0.1
{ | ||
"name": "@arthurgeron/eslint-plugin-react-usememo", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -200,9 +200,8 @@ # eslint-plugin-react-usememo | ||
```JavaScript | ||
const otherData = {}; // Or declare inside hook with useMemo | ||
function getData() { // Or declare inside hook with useCallback | ||
// Doing something | ||
} | ||
const otherData = {}; // Or declare inside hook with useMemo | ||
function useData() { | ||
return useMemo(() => ({ getData, otherData}), []); // The return object itself can be used in dependency arrays | ||
const getData = useCallback(() => { // Or declare statically | ||
}, []); | ||
return {getData, otherData}; | ||
} | ||
@@ -209,0 +208,0 @@ ``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
29659
270