From 5e94655cbbeae6f4b1806fdbfbb9902b136fa574 Mon Sep 17 00:00:00 2001 From: Jorge Cabiedes <57368278+jorge-cab@users.noreply.github.com> Date: Tue, 11 Nov 2025 10:16:20 -0800 Subject: [PATCH] [compiler] _exp version of ValidateNoDerivedComputationsInEffects take precedence over stable version when enabled (#35099) Summary: We should only run one version of the validation. I think it makes sense that if the exp version is enable it takes precedence over the stable one --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/facebook/react/pull/35099). * __->__ #35099 * #35100 --- .../babel-plugin-react-compiler/src/Entrypoint/Pipeline.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Pipeline.ts b/compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Pipeline.ts index 0c777f8770..220c9d5c3d 100644 --- a/compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Pipeline.ts +++ b/compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Pipeline.ts @@ -272,12 +272,10 @@ function runWithEnvironment( validateNoSetStateInRender(hir).unwrap(); } - if (env.config.validateNoDerivedComputationsInEffects) { - validateNoDerivedComputationsInEffects(hir); - } - if (env.config.validateNoDerivedComputationsInEffects_exp) { env.logErrors(validateNoDerivedComputationsInEffects_exp(hir)); + } else if (env.config.validateNoDerivedComputationsInEffects) { + validateNoDerivedComputationsInEffects(hir); } if (env.config.validateNoSetStateInEffects) {