fix: ESLint react-hooks 최신 규칙 호환
- useCallback → 일반 함수 + eslint-disable (초기 데이터 fetch) - ToastProvider: useCallback 프로퍼티 할당 → useMemo 객체 패턴 - SSAFYCallbackPage: eslint-disable-line 추가 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { useState, useEffect, useCallback } from 'react';
|
||||
import { useState, useEffect } from 'react';
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
import { useAuth } from '../context/useAuth';
|
||||
import { getDownloadInfo } from '../api/download';
|
||||
@@ -14,15 +14,16 @@ export default function DownloadSection() {
|
||||
const { user } = useAuth();
|
||||
const navigate = useNavigate();
|
||||
|
||||
const loadInfo = useCallback(() => {
|
||||
const loadInfo = () => {
|
||||
setReady(false);
|
||||
setLoadError(false);
|
||||
getDownloadInfo()
|
||||
.then((data) => { setInfo(data); setReady(true); })
|
||||
.catch(() => { setLoadError(true); setReady(true); });
|
||||
}, []);
|
||||
};
|
||||
|
||||
useEffect(() => { loadInfo(); }, [loadInfo]);
|
||||
// eslint-disable-next-line react-hooks/set-state-in-effect -- initial data fetch on mount
|
||||
useEffect(() => { loadInfo(); }, []);
|
||||
|
||||
const handlePlay = async () => {
|
||||
if (!user) {
|
||||
|
||||
Reference in New Issue
Block a user