useEffect안에 console.log(totalDetail); 하면 콘솔에 하얗게 나오는데
로딩중이라 그런가여??
var [totalDetail, setTotalDetail] = useState('');
useEffect(() => {
axios.get(`http://localhost:4000/Board/${id}`)
.then((response) => {
setTotalDetail(response.data);
console.log(response.data);
})
.catch((error)=>{
console.error('Detail 가져오다가 오류 발생:', error);
});
}, []);