1
+
2
+## Input
3
+
4
+```javascript
5
+//@flow @validatePreserveExistingMemoizationGuarantees @enableNewMutationAliasingModel
6
+component Component(
7
+ onAsyncSubmit?: (() => void) => void,
8
+ onClose: (isConfirmed: boolean) => void
9
+) {
10
+ // When running inferReactiveScopeVariables,
11
+ // onAsyncSubmit and onClose update to share
12
+ // a mutableRange instance.
13
+ const onSubmit = useCallback(() => {
14
+ if (onAsyncSubmit) {
15
+ onAsyncSubmit(() => {
16
+ onClose(true);
17
+ });
18
+ return;
19
+ }
20
+ }, [onAsyncSubmit, onClose]);
21
+ // When running inferReactiveScopeVariables here,
22
+ // first the existing range gets updated (affecting
23
+ // onAsyncSubmit) and then onClose gets assigned a
24
+ // different mutable range instance, which is the
25
+ // one reset after AnalyzeFunctions.
26
+ // The fix is to fully reset mutable ranges *instances*
27
+ // after AnalyzeFunctions visit a function expression
28
+ return <Dialog onSubmit={onSubmit} onClose={() => onClose(false)} />;
29
+}
30
+
31
+```
32
+
33
+## Code
34
+
35
+```javascript
36
+import { c as _c } from "react/compiler-runtime";
37
+function Component(t0) {
38
+ const $ = _c(8);
39
+ const { onAsyncSubmit, onClose } = t0;
40
+ let t1;
41
+ if ($[0] !== onAsyncSubmit || $[1] !== onClose) {
42
+ t1 = () => {
43
+ if (onAsyncSubmit) {
44
+ onAsyncSubmit(() => {
45
+ onClose(true);
46
+ });
47
+ return;
48
+ }
49
+ };
50
+ $[0] = onAsyncSubmit;
51
+ $[1] = onClose;
52
+ $[2] = t1;
53
+ } else {
54
+ t1 = $[2];
55
+ }
56
+ const onSubmit = t1;
57
+ let t2;
58
+ if ($[3] !== onClose) {
59
+ t2 = () => onClose(false);
60
+ $[3] = onClose;
61
+ $[4] = t2;
62
+ } else {
63
+ t2 = $[4];
64
+ }
65
+ let t3;
66
+ if ($[5] !== onSubmit || $[6] !== t2) {
67
+ t3 = <Dialog onSubmit={onSubmit} onClose={t2} />;
68
+ $[5] = onSubmit;
69
+ $[6] = t2;
70
+ $[7] = t3;
71
+ } else {
72
+ t3 = $[7];
73
+ }
74
+ return t3;
75
+}
76
+
77
+```
78
+
79
+### Eval output
80
+(kind: exception) Fixture not implemented
\ No newline at end of file