export function items(state = [], action) {
switch (action.type) {
case 'ITEMS':
return action.items;
default:
return state;
}
}
handleScroll(event) {
this.props.fetchData('url?limit=5&last_id=' + this.props.last_id);
};
componentDidMount() {
this.props.fetchData('url?limit=5');
document.documentElement.addEventListener('scroll', this.handleScroll);
}
componentWillUnmount() {
document.documentElement.removeEventListener('scroll', this.handleScroll);
}
handleScroll() {
this.props.fetchData('url?limit=5&last_id=21323');
}
import React from "react"
fetch("http://api.kai-zer.ru/dev/method/products.getAll")
.then((res) => res.json())
.then((data) => {
const items = data.response.items;
const Image = (namber) => {
return (
<div>
{items[namber].image.url}
</div>
)
}
})
export default Image