Documentation
Rules
debug/react-hooks

react-hooks

Rule category

Debug.

What it does

Reports all React Hooks. Useful for debugging. This rule should only be used for debugging purposes. Otherwise, leave it off.

Examples

import React, { useState } from "react";
 
function useToggle() {
  const [value, setValue] = useState(false);
 
  return [value, () => setValue((x) => !x)] as const;
}