@@ -30733,7 +30733,7 @@ const EnvironmentConfigSchema = zod.z.object({
3073330733 enableChangeDetectionForDebugging: ExternalFunctionSchema.nullable().default(null),
3073430734 enableCustomTypeDefinitionForReanimated: zod.z.boolean().default(false),
3073530735 hookPattern: zod.z.string().nullable().default(null),
30736- enableTreatRefLikeIdentifiersAsRefs: zod.z.boolean().default(false ),
30736+ enableTreatRefLikeIdentifiersAsRefs: zod.z.boolean().default(true ),
3073730737 lowerContextAccess: ExternalFunctionSchema.nullable().default(null),
3073830738 validateNoVoidUseMemo: zod.z.boolean().default(false),
3073930739});
@@ -48334,6 +48334,19 @@ function validateNoRefAccessInRenderImpl(fn, env) {
4833448334 const type = refTypeOfType(place);
4833548335 env.set(place.identifier.id, type);
4833648336 }
48337+ const interpolatedAsJsx = new Set();
48338+ for (const block of fn.body.blocks.values()) {
48339+ for (const instr of block.instructions) {
48340+ const { value } = instr;
48341+ if (value.kind === 'JsxExpression' || value.kind === 'JsxFragment') {
48342+ if (value.children != null) {
48343+ for (const child of value.children) {
48344+ interpolatedAsJsx.add(child.identifier.id);
48345+ }
48346+ }
48347+ }
48348+ }
48349+ }
4833748350 for (let i = 0; (i == 0 || env.hasChanged()) && i < 10; i++) {
4833848351 env.resetChanged();
4833948352 returnValues = [];
@@ -48447,10 +48460,13 @@ function validateNoRefAccessInRenderImpl(fn, env) {
4844748460 if (!didError) {
4844848461 const isRefLValue = isUseRefType(instr.lvalue.identifier);
4844948462 for (const operand of eachInstructionValueOperand(instr.value)) {
48450- if (hookKind != null) {
48463+ if (isRefLValue || hookKind != null) {
4845148464 validateNoDirectRefValueAccess(errors, operand, env);
4845248465 }
48453- else if (!isRefLValue) {
48466+ else if (interpolatedAsJsx.has(instr.lvalue.identifier.id)) {
48467+ validateNoRefValueAccess(errors, env, operand);
48468+ }
48469+ else {
4845448470 validateNoRefPassedToFunction(errors, env, operand, operand.loc);
4845548471 }
4845648472 }
0 commit comments