data.map(el => {
<div onClick={() => handleClick(el.id)}>
})
data.map(el => {
return <div onClick={() => handleClick(el.id)}>;
})
data.map(el => <div onClick={() => handleClick(el.id)}>)
const dateFormatter = (date) => {
const preparedDate = date.replace( /(\d{2}).(\d{2}).(\d{2})/, "$2.$1.$3");
let dateStr = new Date(preparedDate).toLocaleString('ru-RU', {
month: "long",
day: "numeric"
})
return dateStr
}
dateFormatter('11.04.2020') //"11 апреля"
async function getData() {
...
}
async function handle() {
const data = await getData();
console.log(data[0].NumberStop);
...
}
handle();
let data = await getData();
const json = await response.json();
<button class="btn btn-blue">
Button
</button>
<style>
.btn {
@apply font-bold py-2 px-4 rounded;
@screen sm {
@apply py-3 px-5;
}
}
.btn-blue {
@apply bg-blue-500 text-white;
}
.btn-blue:hover {
@apply bg-blue-600;
}
</style>