我想知道如何使用withPropsOnChange
内部变量?我有一个对象person
,其中包含 2 个对象,我只想withPropsOnChange
在它们(特别更改)时运行
{ name: 'dave', location: 'usa', age: 31 }
对于这个对象示例,我withPropsOnChange
只希望name
和/或被location
更改,那么我该怎么做呢?
这是我如何尝试使用它的示例,
https ://codepen.io/anon/pen/xWvrLV?editors=1111,
因为您将看到console.log
doe 显示更新(就像子组件将收到道具更改但withPropsOnChange
赢了'不抓住它)不知道如何以正确的方式做到这一点。
谢谢