import { useState, useEffect } from 'react'; import { useAuth } from "../utils/context"; import { Link } from "react-router-dom"; import StudyPlanCard from "./Card/StudyPlanCard"; import subjectApi from '../apis/subject.api'; import styles from "./StudyPlan/studyplan.module.scss"; const StudyPlanList = () => { const { user } = useAuth(); const [renList, setRenList] = useState([]); useEffect(() => { getList(user.id); }, []) async function getList(id) { const result = await subjectApi.allSubject(id) setRenList(result) } //여기서 삭제함수 만들어서 StudyPlanCard에게 넘기기 return (
{renList.length !== 0 ? renList.map((info, idx) => ) : null}

새로운 과목 추가하기

) } export default StudyPlanList;