logoESLint React
Rules

is-from-ref

Reports all identifiers initialized or derived from refs in JSON format. Useful for debugging. This rule should only be used for debugging purposes; otherwise, leave it off.

Full Name in eslint-plugin-react-debug

react-debug/is-from-ref

Features

🐞

Presets

Rule Details

import React from "react";

function MyComponent() {
  const myRef = React.useRef(42);
  //    ^^^^^
  //    - {"name": "myRef", "init": "React.useRef(42)"}
  const value = myRef.current;
  //    ^^^^^
  //    - {"name": "value", "init": "myRef.current"}

  return null;
}

Resources


See Also

On this page