Регулярное выражение для uuid:
[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}
Ваш ответ на обещание не разделяет область действия this, поэтому используйте функцию стрелки внутри отклика then ...
postdata_fire(){
Postdata('http://localhost:3000/places').then((result) =>{
console.log("result::",result);
this.setState({result:'sdujoij'})
})
this.setState({hits:'yahittsss'})
console.log("hits:::",this.state.hits);
}
Вам потребуется рефакторинг postdata_fire следующим образом:
postdata_fire() {
Postdata('http://localhost:3000/places').then(result => {
console.log("result:: %j",result);
this.setState({result_: result});
});
...
}
и Postdata тоже:
export const Postdata = (url='') => {
return fetch(url).then(response => {
console.log("response.json()::",response)
return response.json();
});
}