#3837·formily

[Bug Report] formily react被动联动计算与预期不符合

Author: febugcoderCreated May 30, 2023Updated Dec 24, 2025
Labelsbug
  • I have searched the issues of this repository and believe that this is not a duplicate.

Reproduction link

Edit on CodeSandbox

Steps to reproduce

需求

有A、B、C、D四个字段,其中C = A / B,D = C * B

react版本有问题:https://codesandbox.io/s/admiring-glade-puqoq5?file=/src/App.js:539-551

reactive版本没问题:https://codesandbox.io/s/empty-star-pk8sic?file=/src/index.js

操作步骤

  1. 输入A = 2
  2. 输入B = 1
  3. 此时C会计算出来2,但是D没有算出值

问题

为什么D会计算不出来结果?当C被计算出来之后,为什么D的onFieldReact没有再跑一次?

What is expected?

按操作步骤,能计算出D值

What is actually happening?

按操作步骤,无法计算出D值

Package

@formily/[email protected]