![](/img/trans.png)
[英]What is the easiest way to change a object's properties which are in b without override the object?
[英]What is the easiest way to detect the state change of a complex object in Reactjs
我有一個復雜的 object 如下
const myObject = {
title:"main title",
row:[
{rowTitle:"t1",index:1},
{rowTitle:"t2",index:2}
],
column:[
{columnTitle:"c1",index:1},
{columnTitle:"c2",index:2},
]
}
我需要檢測屬性是否發生變化。
isObjectUpdated(myObject){
// return true/false
}
如果您希望在此 object 發生更改時重新安裝組件/屏幕,您可以使用useState()
掛鈎來實現此行為。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.