diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/error.todo-repro-no-value-for-temporary-reactive-scope-with-early-return.expect.md b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/error.todo-repro-no-value-for-temporary-reactive-scope-with-early-return.expect.md new file mode 100644 index 0000000000..90d266cdf2 --- /dev/null +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/error.todo-repro-no-value-for-temporary-reactive-scope-with-early-return.expect.md @@ -0,0 +1,40 @@ + +## Input + +```javascript +// @flow @enableAssumeHooksFollowRulesOfReact @enableTransitivelyFreezeFunctionExpressions +import { identity, makeObject_Primitives } from "shared-runtime"; + +function Component(props) { + const object = makeObject_Primitives(); + const cond = makeObject_Primitives(); + if (!cond) { + return null; + } + + return ( +
+ {fbt( + "Lorum ipsum" + fbt.param("thing", object.b) + " blah blah blah", + "More text" + )} +
+ ); +} + +``` + + +## Error + +``` + 10 | + 11 | return ( +> 12 |
+ | ^^^^^ [ReactForget] Invariant: [Codegen] No value found for temporary. Value for 'read $40:TPrimitive' was not set in the codegen context (12:12) + 13 | {fbt( + 14 | "Lorum ipsum" + fbt.param("thing", object.b) + " blah blah blah", + 15 | "More text" +``` + + \ No newline at end of file diff --git a/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/error.todo-repro-no-value-for-temporary-reactive-scope-with-early-return.js b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/error.todo-repro-no-value-for-temporary-reactive-scope-with-early-return.js new file mode 100644 index 0000000000..8ec2b25ff2 --- /dev/null +++ b/compiler/packages/babel-plugin-react-forget/src/__tests__/fixtures/compiler/error.todo-repro-no-value-for-temporary-reactive-scope-with-early-return.js @@ -0,0 +1,19 @@ +// @flow @enableAssumeHooksFollowRulesOfReact @enableTransitivelyFreezeFunctionExpressions +import { identity, makeObject_Primitives } from "shared-runtime"; + +function Component(props) { + const object = makeObject_Primitives(); + const cond = makeObject_Primitives(); + if (!cond) { + return null; + } + + return ( +
+ {fbt( + "Lorum ipsum" + fbt.param("thing", object.b) + " blah blah blah", + "More text" + )} +
+ ); +}