You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enforces function calls made inside `useState`to be wrapped in an `initializer function`.
28
28
29
29
A function can be invoked inside a useState call to help create its initial state. However, subsequent renders will still invoke the function while discarding its return value. This is wasteful and can cause performance issues if the function call is expensive.
|[`no-direct-set-state-in-use-effect`](hooks-extra-no-direct-set-state-in-use-effect)| 1️⃣ |`🔍`| Disallow direct calls to the `set` function of `useState` in `useEffect`. |
115
-
|[`no-direct-set-state-in-use-layout-effect`](hooks-extra-no-direct-set-state-in-use-layout-effect)| 0️⃣ |`🔍`| Disallow direct calls to the `set` function of `useState` in `useLayoutEffect`. |
116
-
|[`no-unnecessary-use-callback`](hooks-extra-no-unnecessary-use-callback)| 0️⃣ |`🔍`| Disallow unnecessary usage of `useCallback`. |
117
-
|[`no-unnecessary-use-memo`](hooks-extra-no-unnecessary-use-memo)| 0️⃣ |`🔍`| Disallow unnecessary usage of `useMemo`. |
118
-
|[`no-useless-custom-hooks`](hooks-extra-no-useless-custom-hooks)| 1️⃣ |`🔍`| Enforces custom Hooks to use at least one other Hook.|
119
-
|[`prefer-use-state-lazy-initialization`](hooks-extra-prefer-use-state-lazy-initialization)| 1️⃣ |`🔍`|Warns function calls made inside `useState`calls. |
|[`no-direct-set-state-in-use-effect`](hooks-extra-no-direct-set-state-in-use-effect)| 1️⃣ |`🔍`| Disallow direct calls to the `set` function of `useState` in `useEffect`. |
115
+
|[`no-direct-set-state-in-use-layout-effect`](hooks-extra-no-direct-set-state-in-use-layout-effect)| 0️⃣ |`🔍`| Disallow direct calls to the `set` function of `useState` in `useLayoutEffect`. |
116
+
|[`no-unnecessary-use-callback`](hooks-extra-no-unnecessary-use-callback)| 0️⃣ |`🔍`| Disallow unnecessary usage of `useCallback`. |
117
+
|[`no-unnecessary-use-memo`](hooks-extra-no-unnecessary-use-memo)| 0️⃣ |`🔍`| Disallow unnecessary usage of `useMemo`. |
118
+
|[`no-useless-custom-hooks`](hooks-extra-no-useless-custom-hooks)| 1️⃣ |`🔍`| Enforces custom Hooks to use at least one other Hook inside. |
119
+
|[`prefer-use-state-lazy-initialization`](hooks-extra-prefer-use-state-lazy-initialization)| 1️⃣ |`🔍`|Enforces function calls made inside `useState`to be wrapped in an `initializer function`.|
0 commit comments