JavaScript
- 1 ответ
- 0 вопросов
0
Вклад в тег
const [product, setProduct] = useState([]);
const [productsCount, setProductsCount] = useState(8);
useEffect(() => {
axios.get(`https://fakestoreapi.com/products?limit=${productsCount}`).then((response) => {
setProduct(response.data)
}
}, [productsCount])
const viewMoreHandle = () => {
setProductsCount(prev => prev+5)
}