1
+
2
+## Input
3
+
4
+```javascript
5
+// @enablePreserveExistingMemoizationGuarantees
6
+import {fbt} from 'fbt';
7
+
8
+function Component() {
9
+ const buttonLabel = () => {
10
+ if (!someCondition) {
11
+ return <fbt desc="My label">{'Purchase as a gift'}</fbt>;
12
+ } else if (
13
+ !iconOnly &&
14
+ showPrice &&
15
+ item?.current_gift_offer?.price?.formatted != null
16
+ ) {
17
+ return (
18
+ <fbt desc="Gift button's label">
19
+ {'Gift | '}
20
+ <fbt:param name="price">
21
+ {item?.current_gift_offer?.price?.formatted}
22
+ </fbt:param>
23
+ </fbt>
24
+ );
25
+ } else if (!iconOnly && !showPrice) {
26
+ return <fbt desc="Gift button's label">{'Gift'}</fbt>;
27
+ }
28
+ };
29
+
30
+ return (
31
+ <View>
32
+ <Button text={buttonLabel()} />
33
+ </View>
34
+ );
35
+}
36
+
37
+```
38
+
39
+## Code
40
+
41
+```javascript
42
+import { c as _c } from "react/compiler-runtime"; // @enablePreserveExistingMemoizationGuarantees
43
+import { fbt } from "fbt";
44
+
45
+function Component() {
46
+ const $ = _c(1);
47
+ const buttonLabel = _temp;
48
+ let t0;
49
+ if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
50
+ t0 = (
51
+ <View>
52
+ <Button text={buttonLabel()} />
53
+ </View>
54
+ );
55
+ $[0] = t0;
56
+ } else {
57
+ t0 = $[0];
58
+ }
59
+ return t0;
60
+}
61
+function _temp() {
62
+ if (!someCondition) {
63
+ return fbt._("Purchase as a gift", null, { hk: "1gHj4g" });
64
+ } else {
65
+ if (
66
+ !iconOnly &&
67
+ showPrice &&
68
+ item?.current_gift_offer?.price?.formatted != null
69
+ ) {
70
+ return fbt._(
71
+ "Gift | {price}",
72
+ [fbt._param("price", item?.current_gift_offer?.price?.formatted)],
73
+ { hk: "3GTnGE" },
74
+ );
75
+ } else {
76
+ if (!iconOnly && !showPrice) {
77
+ return fbt._("Gift", null, { hk: "3fqfrk" });
78
+ }
79
+ }
80
+ }
81
+}
82
+
83
+```
84
+
85
+### Eval output
86
+(kind: exception) Fixture not implemented
\ No newline at end of file