$## Context\n\nPR #23 (dependabot) attempted to upgrade eslint-plugin-react-hooks from 4.6.2 to 7.1.1, but the new version introduces strict set-state-in-effect and purity rules that flag 30 occurrences across the codebase.\n\nThese are valid improvements from the React team.\n\n## Required Fixes\n\n### 1. set-state-in-effect (28 errors)\n\nMove setLoading(true) calls from inside useEffect into the async functions themselves.\n\nAffected files:\n\n- AdminPanel.tsx — Lines 94, 291, 583\n- UserManagement.tsx — Lines 102, 423, 647\n- TableStructure.tsx — Line 29\n\nFix pattern:\n\ntsx\n// BEFORE\nuseEffect(() => {\n setLoading(true);\n fetchData();\n}, []);\n\n// AFTER\nuseEffect(() => {\n fetchData();\n}, []);\n\n// And inside async function:\nconst fetchData = async () => {\n setLoading(true);\n try { ... } finally { setLoading(false); }\n};\n\n\n### 2. purity (1 error)\n\n- RoutineViewer.tsx — Line 108: performance.now() inside component body\n\n## Acceptance Criteria\n\n- [ ] All 30 set-state-in-effect fixed\n- [ ] purity error in RoutineViewer.tsx fixed\n- [ ] npm run lint passes with zero errors\n- [ ] All tests still pass\n- [ ] eslint-plugin-react-hooks updated to v7.1.1
$## Context\n\nPR #23 (dependabot) attempted to upgrade eslint-plugin-react-hooks from 4.6.2 to 7.1.1, but the new version introduces strict
set-state-in-effectandpurityrules that flag 30 occurrences across the codebase.\n\nThese are valid improvements from the React team.\n\n## Required Fixes\n\n### 1.set-state-in-effect(28 errors)\n\nMovesetLoading(true)calls from insideuseEffectinto the async functions themselves.\n\nAffected files:\n\n- AdminPanel.tsx — Lines 94, 291, 583\n- UserManagement.tsx — Lines 102, 423, 647\n- TableStructure.tsx — Line 29\n\nFix pattern:\n\ntsx\n// BEFORE\nuseEffect(() => {\n setLoading(true);\n fetchData();\n}, []);\n\n// AFTER\nuseEffect(() => {\n fetchData();\n}, []);\n\n// And inside async function:\nconst fetchData = async () => {\n setLoading(true);\n try { ... } finally { setLoading(false); }\n};\n\n\n### 2.purity(1 error)\n\n- RoutineViewer.tsx — Line 108:performance.now()inside component body\n\n## Acceptance Criteria\n\n- [ ] All 30set-state-in-effectfixed\n- [ ]purityerror in RoutineViewer.tsx fixed\n- [ ]npm run lintpasses with zero errors\n- [ ] All tests still pass\n- [ ] eslint-plugin-react-hooks updated to v7.1.1