Skip to content
Advertisement

Tag: reactjs

How can i get rid of “” in JSON format?

I am trying to represent JSON formated data Using React library Victory here it is. example of component: but I get my data from API in JSON format notice format of data: What type of array is used in first fragment? And how can I make it from the second? Answer Use data.historical as the array in your component.

Select a grid element from a .map

I have a grid and I need to select the fourth element and move from the first column to second column in the row below. I know how to do it in plain html, but not how to select the grid element inside a map. Here the code: I just need to select the fourth element and put this className:

More elegant way of checking all state values

Is there a more elegant way of checking all state variables in my react app ? I currently have 14 state variables within my app, I am checking the value of each and updating to an empty string if they do not pass validation (left empty) code is as: This does work, so its not the end of the world,

Advertisement