Commit 171d2ef
Erik Rasmussen
fix: always advance prevInitialValueRef regardless of undefined
Previously the ref was only updated inside the 'initialValue !== undefined'
branch, so a transition like "foo" → undefined → "foo" would leave the ref
stuck at "foo" and the second change would look like a no-op, leaving
dirty/pristine state stale.
Move the ref update unconditionally before the condition check, while keeping
the registration logic gated on 'initialValue !== undefined'.
Addresses CodeRabbit review comment.1 parent 4fa6600 commit 171d2ef
1 file changed
Lines changed: 6 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
197 | 197 | | |
198 | 198 | | |
199 | 199 | | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| |||
0 commit comments