I’ve got a problem with making a correct loop in React. I want to fetch data from JSON to don’t repeat components. I tried to make two loops and then two maps, but everything was in bad order. The other problem is that “description” is also an array that’s why I’m not able …
Tag: reactjs
Filter list of Objects according to the month?
I am using graphs, so whenever I choose to show data according to the months, I will have to show data for the each month, I have fields like totalAmount, paidAmount , I should sum data for that month. In that list, I have invoiceDate, one object is of april month and other is of May month. Click here what
React : Empty values on PUT for axios
I have a simple list that I get from an API using axios. Every element is a modifiable input, with it own update button. After changing the data of an input, and while performing PUT request, console.log(test); returns empty values. I checked console.log(newList); which is the array of the list, and the chang…
How to make a post request to create new users
I’m creating a chat app with react-chat-engine. And everything is working fine. Except for the fact that I don’t know how to make a post request to create new users. Here’s my code I’m trying to add a new user to the users. But it keeps throwing this error to the console. What can I do…
Issues With Filtering and Re-Displaying Data ReactJS
I’m trying to filter through the RandomUser api to display either males or females. My current issue is that I can’t display the filtered data like I did the original data. Here’s my current code: I think my issue applies to how I originally setup my html with my if/else statement leading to…
What is a better approach to searching a large array for a particular entry multiple times on the same page?
I want to display many icons on the same page but I understand looping through the same array many times each render is too much work and it will reduce performance especially in slower devices. How do you approach this problem? The allIconsSet array is stored and exported in a file and bundled in the app. Th…
not able to update state in reactsJs
i am using table input field to update state under map function to render it according to number of elements in the state.But when I used value={item.account} values are not updated in the state.which works fine when I use **value={accountCounter.account} where accountCounter is reactjs hook of type And here …
How can I set the new Date to 1 minute later?
I made the second argument function of the schedule run one day later through the new Date. However, I want to change it in a minute, not in a day. How do I fix the code? this is my code Answer
Put a dynamic src for an img (React/JS)
I created a function that returns a img tag with a dynamic src, Everything works but I want to make it shorter : Dirty version Cleaner attempt version But for my cleaner attempt, the image is not shown 🙁 Answer Kind of a solution; you can put the images to an object and then
how to fetch api data using react js
At what i am trying to do is when i click on checkbox 1st row in table and then click submit button then url image is not open . i want to make when i click on checkbox then click submit button then url image is open. how can we do that any idea or help its very thankful. my