const List = ({ list }) => (
<ul>
{list.map(item => <Item key={item.id} data={item} />)}
</ul>
) ;
fetchData() {
const { searchValue } = this.state;
fetch("http://localhost:8080/api/users/?name="+searchValue)
.then(/* ... */)
.catch(/* ... */);
}
onSearchClick = () => {
this.setState(prevState => ({
searchValue: prevState.searchInputValue,
}), this.fetchData);
};
Это ужасно. Учите английский язык.