Hi i have a list of objects as state, example [ { id: 1 , value: “test1”}, { id: 2 , value: “test2”} ]. I would like to add it to a dependency array so that any time the object is modified the useEffect/useMemo gets called. But since the object is in state the reference to the object is the same and as such the dependency doesn’t work. Is there any good solution for this?
submitted by /u/Kunskapskapitalet
[link] [comments]