코드와 에러 첨부합니다 !
왜 안되는지 잘 모르겠습니다 ㅎㅎㅎ
let [loading, loading변경] = useState(true);
<button className="btn btn-primary" onClick={()=>{
{
loading === true
? (<div><p>Loading...</p></div>)
: null
}
axios.get('https://codingapple1.github.io/shop/data2.json')
.then((result)=>{
loading변경(false);
shoes변경 ([ ...shoes, ...result.data ])
})
.catch(()=>{
loading변경(false);
})
}}>더보기</button>
Expected an assignment or function call and instead saw an expression no-unused-expressions
Search for the keywords to learn more about each error.