Commit e9da67c
fix: use macroTask before raf in delayFrame
The delayFrame function was using only raf, which could execute before
useWatch's React render completes. useWatch updates are scheduled via
macroTask (MessageChannel), and raf may run before or after macroTask
depending on the environment.
By adding macroTask before raf, we ensure the execution order is:
1. useWatch's macroTask executes → React setState
2. delayFrame's macroTask executes
3. raf executes → validation starts
This guarantees useWatch has updated before rules validation runs.
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>1 parent fc66fbb commit e9da67c
2 files changed
+6
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
| 8 | + | |
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
1 | 2 | | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
5 | | - | |
6 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
7 | 10 | | |
8 | 11 | | |
9 | 12 | | |
0 commit comments