Relative Content

Tag Archive for reactjsarraysnext.jsreact-hooksserver-side-rendering

React: when an element in an array gets deleted, all subsequent elements gets re-rendered, while the previous don’t

In this project (React with NextJS), the user can see various statistics, statistics like how many orders a certain rider made, how many hours it worked and so on. The user is not limited to just one “section”, they can add and remove as many sections as they wants so that they compare, for example, the stats of a certain rider vs another rider. The code here represents the page where these sections are shown. The key is that I have a useState containing an array of “Stats” nodes (the dialogs I talked about):