1
+
2
+## Input
3
+
4
+```javascript
5
+import { useMemo } from "react";
6
+
7
+function Component(props) {
8
+ const outerHandlers = useMemo(() => {
9
+ let handlers = { value: props.value };
10
+ switch (props.test) {
11
+ case true: {
12
+ console.log(handlers.value);
13
+ break;
14
+ }
15
+ default: {
16
+ }
17
+ }
18
+ return handlers;
19
+ });
20
+ return outerHandlers;
21
+}
22
+
23
+export const FIXTURE_ENTRYPOINT = {
24
+ fn: Component,
25
+ params: [{ test: true, value: "hello" }],
26
+};
27
+
28
+```
29
+
30
+## Code
31
+
32
+```javascript
33
+import { useMemo, unstable_useMemoCache as useMemoCache } from "react";
34
+
35
+function Component(props) {
36
+ const $ = useMemoCache(2);
37
+ let t22;
38
+ bb2: {
39
+ let t0;
40
+ if ($[0] !== props.value) {
41
+ t0 = { value: props.value };
42
+ $[0] = props.value;
43
+ $[1] = t0;
44
+ } else {
45
+ t0 = $[1];
46
+ }
47
+ const handlers = t0;
48
+ switch (props.test) {
49
+ case true: {
50
+ console.log(handlers.value);
51
+ break bb2;
52
+ }
53
+ default: {
54
+ }
55
+ }
56
+ }
57
+
58
+ t22 = handlers;
59
+ const outerHandlers = t22;
60
+ return outerHandlers;
61
+}
62
+
63
+export const FIXTURE_ENTRYPOINT = {
64
+ fn: Component,
65
+ params: [{ test: true, value: "hello" }],
66
+};
67
+
68
+```
69
+
70
+### Eval output
71
+(kind: exception) handlers.foo is not a function
72
+logs: ['The above error occurred in the <WrapperTestComponent> component:\n' +
73
+ '\n' +
74
+ ' at WrapperTestComponent (<project_root>/packages/sprout/dist/runner-evaluator.js:55:26)\n' +
75
+ '\n' +
76
+ 'Consider adding an error boundary to your tree to customize error handling behavior.\n' +
77
+ 'Visit https://reactjs.org/link/error-boundaries to learn more about error boundaries.']
\ No newline at end of file