const [data, setData] = useState(null);
const fetchOrderError = async (orderId) => {
const orderErrorData = await getOrderError(orderId);
setData(orderErrorData);
};
useEffect(() => {
fetchOrderError();
}, []);
return (
<h2 className={styles['title']}>{data}</h2>
);
const productInfoStorage = localStorage.setItem('productInfo', JSON.stringify([cartCardHTML]))
const alreadyInStorage = JSON.parse(localStorage.getItem('productInfo'));
const productInfoStorage = localStorage.setItem('productInfo', JSON.stringify([...alreadyInStorage, cartCardHTML]))
function calculate(event){
if (!isNaN(event.target.value)){
event.target.style.color = "black";
if (debug) console.log("-----> p1");
}
else{
event.target.style.color = "red";
if (debug) console.log("-----> p2");
}
}
const x1 = document.querySelector('#x1');
x1.addEventListener( 'input' , calculate);
fetch("https://api.jsonbin.io/v3/b", requestOptions)
Его можно прописать в массиве с объектами, по которому мы пробегаемся через map, а далее достать {game.path} и поместить в Link to.Верно?
path="/tovari/:id"
const { id } = useParams();
А зачем если есть onclick?
acc.push(n.value)
?n = { name: 'some name', value: 'val' }; // Исходя из типа NameInput, в n может попасть такое значение, например
acc[n.name] => acc['some name'] => не может у массива быть такого (строкового) индекса