Skip to content

Lint: fix set-state-in-effect violations in row/visualization components #184

Description

@Trosper3

Problem

react-hooks/set-state-in-effect also fires in the row/visualization UI components (separate area from #183's provider cluster):

  • components/pageblocks/ProblemRowReact.js:154
  • components/pageblocks/VerifyRowReact.js:46, 52
  • components/pageblocks/VisualizeRowReact.js:135, 139
  • components/Visualization/QuantumCircuitVis.js:152

6 occurrences across 4 files.

Fix

Same pattern as #183 (setState called synchronously inside a useEffect) but a different code area with a different owner/review surface, so tracked separately. Restructure each effect: derive state during render, or move the update into the triggering event handler.

Acceptance

npx eslint . no longer reports react-hooks/set-state-in-effect for these 4 files, and the affected rows/visualizations still render and update correctly (manually verify in browser).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions