import React, { useState, useEffect } from 'react'; import Menu from '../Components/Menu'; import axios from 'axios'; function Notice() { const [notices, setNotices] = useState([]); useEffect(() => { getNotice(); }, []); function getNotice() { axios.get(`/notices`) .then(res => { if (res.status !== 201) { alert(res.data.error); } console.log(res.data); setNotices(res.data); }) .catch(err => { alert(err.error) }); } return (