Skip to content

Lint baseline: 47 react-hooks/refs warnings after eslint-plugin-react-hooks v7 #219

Description

@gizmax

Context

PR #217 added .github/workflows/pr-tests.yml which runs ESLint. The freshly installed eslint-plugin-react-hooks v7 ships new rules (notably react-hooks/refs about accessing refs during render) that flag 47 pre-existing issues. ESLint is currently configured as advisory (continue-on-error) in the CI workflow.

Affected files

Why the rule is correct

isSectionDirty() reads refs to compute its return value. Calling it inline in JSX accesses ref.current during render, which can produce stale UI when the ref changes without triggering re-render. React's docs recommend either:

  1. Reading the ref into a state value in useEffect, or
  2. Forcing a re-render via useState when the ref changes.

Effort

Each call site is a few lines. 47 sites total. Could be a single focused PR.

Acceptance

  • npm run lint exits 0
  • Remove continue-on-error from .github/workflows/pr-tests.yml ESLint step

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions