【发布时间】:2022-05-05 16:04:12
【问题描述】:
Mobx 支持 @observable 和 @observable.ref 修饰符,他们的官方文档说
observable: This is the default modifier, used by any observable. It clones and converts any (not yet observable) array, Map or plain object into it's observable counterpart upon assignment to the given property
observable.ref: Disables automatic observable conversion, just creates an observable reference instead.
我不明白为什么我们需要为已经存在的 observable 创建 observable 引用。这两个有何不同,它们的用例是什么?
【问题讨论】:
标签: javascript observable mobx mobx-react