react/compiler/packages/babel-plugin-react-compiler/src
Joseph Savona 2bcbf254f1
[compiler] Fix false positive for useMemo reassigning context vars (#34904)
Within a function expression local variables may use StoreContext for
local context variables, so the reassignment check here was firing too
often. We should only report an error for variables that are declared
outside the function, ie part of its `context`.

---
[//]: # (BEGIN SAPLING FOOTER)
Stack created with [Sapling](https://sapling-scm.com). Best reviewed
with [ReviewStack](https://reviewstack.dev/facebook/react/pull/34904).
* #34903
* __->__ #34904
2025-10-20 08:42:04 -07:00
..
__tests__ [compiler] Fix false positive for useMemo reassigning context vars (#34904) 2025-10-20 08:42:04 -07:00
Babel [compiler] Export PluginOptions as a type that can be used in input positions (#34550) 2025-09-22 18:28:19 +02:00
Entrypoint [compiler] improve zod v3 backwards compat (#34877) 2025-10-16 09:46:55 -07:00
Flood [compiler] Migrate CompilerError.invariant to new CompilerDiagnostic infra (#34403) 2025-09-06 12:58:08 -04:00
HIR [compiler] More fbt compatibility (#34887) 2025-10-17 11:37:28 -07:00
Inference [compiler] Optimize props spread for common cases (#34900) 2025-10-17 11:59:17 -07:00
Optimization [compiler] Improve name hints for outlined functions (#34434) 2025-09-09 12:14:09 -07:00
ReactiveScopes [compiler] More fbt compatibility (#34887) 2025-10-17 11:37:28 -07:00
SSA [compiler] Migrate CompilerError.invariant to new CompilerDiagnostic infra (#34403) 2025-09-06 12:58:08 -04:00
Transform [compiler] Name anonymous functions from inlined useCallbacks (#34586) 2025-09-24 09:18:16 -07:00
TypeInference [compiler] Infer types for properties after holes in array patterns (#34847) 2025-10-15 09:45:06 -07:00
Utils [compiler] More fbt compatibility (#34887) 2025-10-17 11:37:28 -07:00
Validation [compiler] Fix false positive for useMemo reassigning context vars (#34904) 2025-10-20 08:42:04 -07:00
CompilerError.ts [compiler] Cleanup and enable validateNoVoidUseMemo (#34882) 2025-10-16 13:08:57 -07:00
index.ts [compiler] Setup RecommendedLatest preset (#34782) 2025-10-08 15:45:22 -04:00