Reputation: 728
I have a complex object as follows
const myObject = {
title:"main title",
row:[
{rowTitle:"t1",index:1},
{rowTitle:"t2",index:2}
],
column:[
{columnTitle:"c1",index:1},
{columnTitle:"c2",index:2},
]
}
I need to detect if the properties change or not.
isObjectUpdated(myObject){
// return true/false
}
Upvotes: 0
Views: 1007
Reputation: 101
In the case that you want the component / screen to be remounted if this object changes, you can use the useState()
hook to achieve this behavior.
Upvotes: 2