Skip to content

Tag: reactjs

Filtering data after fetching in React

I need to make a list of objects based on combined data from 2 arrays, one comes from a localStorage and the second one from Django backend. First of all objects from localStorage are displayed by showCart() function it returns data in this format: FE: { id: 1, amount: 7, size: “L”, product: 1 }. …

Append to array in async for loop

I’ve got this function which contains other nested async functions. I’m unzipping a zipfile and then appending each HTMLImageElement to an array. However, the array is printing like this 16 is the correct number of images I’m expecting, but they’re undefined when I console.log() them. …

React text dropdown toggle (toggles all)

I am trying to make a small text dropdown. When you click on the heading text, the p tag will show. It is working, but.. it is toggling all of them, when I only click on of them. I have multiple “li” tags with text and the function. So I am not looping anything Answer Based on your question and

How to change just one parameter using Redux?

I try to update my global state using Redux, but I try to update just one paramter of five, not all. My store code looks like: I tried to write a new case like, but doesn’t work: VS Code doesn’t let me write that “.activated” My dispatch look like: What is wrong? Answer I understand wh…