let result = useQuery('작명', ()=>
axios.get('https://codingapple1.github.io/userdata.json').then((a)=> {
return a.data
})
)
으로 선생님과 똑같이 코드를 쳤는데
<Nav className='ms-auto'>
{result.isLoading ?'로딩중' :result.data.name}
</Nav>
여기서 이제 로딩이 끝나고 정상적이면 json의 name을 가져와야하는데
Cannot read properties of undefined (reading 'name')
TypeError: Cannot read properties of undefined (reading 'name')
json에 name없다고 뜨네요 강의랑 똑같이 치고 오타도 없는데 왜그럴까요...
오류나 로딩중은 잘됩니다