ui/ performance optimization - #9
Conversation
| <PathListItem changeLogItem={change} showChangeType={type} /></div>) | ||
| } | ||
| {filteredChanges?.map((change: DataItem, index: number) => | ||
| <PathListItem key={index} changeLogItem={change} showChangeType={type} /> |
There was a problem hiding this comment.
it is not best practice to use index for react element key..
do we have maybe a key or some identifier for each dataItem that we can use instead?
There was a problem hiding this comment.
i know...but we dont have identifier.
should i inject it once the data injected?
| @@ -0,0 +1,24 @@ | |||
| import { useState, useEffect } from "react"; | |||
|
|
|||
| const useDebounce = (value, delay) => { | |||
There was a problem hiding this comment.
why can't we use lodash debounce or something else that already exists?
There was a problem hiding this comment.
its the solution i found to seperate the state update and the filter operation.
I as see it the trade off will be to hold another variable and make the debounce on him and useEffect to listen to that change to make the filter operation.
I come from the assumption, the state must be updated immediately
* tooltip & width change (#7) Co-authored-by: Leon <> * Ui/group-changes-by-change-type (#8) map changes Co-authored-by: Leon <> * ui/ performance optimization (#9) * avoid unnecessery renderes * removed redundant code * added category change header * cleaned redeundant * pr comments * put color Co-authored-by: Leon <> * ui/ restore collapse button (#12) * avoid unnecessery renderes * removed redundant code * recover lost change type header * added category change header * cleaned redeundant * pr comments * put color * split accordions state to 2 atoms * atom rename * spaces removed * fix bad setState * reverst change * rel changed * pr comments Co-authored-by: Leon <> Co-authored-by: Gustavo Massaneiro <gustavomassa123@gmail.com>
No description provided.