Skip to content

Tag: reactjs

Generating random array in reactjs

I’m trying to generate a specific size random array in reactjs everytime a user hits a button. The code to generate the array is the following: This code seems to work when I test it separately. I can call it how many times I want and it will still work. However when I use this function with a simple re…

React: Selecting an element by id prints the wrong element

Hello! So, I am working on this list in react, when I add two elements to my list, and remove the first one added, it prints the other element that is left in the list. Is this normal? the ‘id’ is applied on creation of the list element and contains the title + unique ID applied to the object. Not