Answer the question
In order to leave comments, you need to log in
How to correctly load data into a React application page?
Hello.
I'm learning React, creating an online store in the process. There was a problem getting data from the server. There is a header containing a list. When you click on a list item, the data is loaded and redirected:
const listCategoriesHandler = (elObj, menuItems) => {
history.push(CLOTHES_PAGE_ROUTE + '/' + menuItems.catName + '/' + menuItems.catName + '/' + elObj.replace(/, | /g, '_'));
fetchCategory([menuItems.catName, elObj.replace(/, | /g, '_')]).then((data) => {
products.setProducts(data);
});
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question