강사님처럼 상품 3개씩 배치되지 않고 한줄에 연달아 계속 추가되는 식으로 나옵니다.
따로 바꿔야 하는 코드가 있을까요?
<Container>
<Row>
{shoes.map((item, i) => {
return(
<Card key={i} shoes={shoes[i]} i={i}/>
)
})}
</Row>
</Container>
{more <= 1 ? (
<button onClick={()=> {
axios.get(`https://codingapple1.github.io/shop/data${2+more}.json`)
.then((res)=>{
let copy = [...shoes, ...res.data];
setShoes(copy);
})
.catch(()=>{
console.log('데이터 가져오기를 실패했습니다');
})
setMore(more+1);
}}>더보기</button>
) : null}