Skip to content

Commit a012a93

Browse files
committed
[compiler] _exp version of ValidateNoDerivedComputationsInEffects take precedence over stable version when enabled
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
1 parent 100fc4a commit a012a93

File tree

1 file changed

+2
-4
lines changed
  • compiler/packages/babel-plugin-react-compiler/src/Entrypoint

1 file changed

+2
-4
lines changed

compiler/packages/babel-plugin-react-compiler/src/Entrypoint/Pipeline.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -272,12 +272,10 @@ function runWithEnvironment(
272272
validateNoSetStateInRender(hir).unwrap();
273273
}
274274

275-
if (env.config.validateNoDerivedComputationsInEffects) {
276-
validateNoDerivedComputationsInEffects(hir);
277-
}
278-
279275
if (env.config.validateNoDerivedComputationsInEffects_exp) {
280276
env.logErrors(validateNoDerivedComputationsInEffects_exp(hir));
277+
} else if (env.config.validateNoDerivedComputationsInEffects) {
278+
validateNoDerivedComputationsInEffects(hir);
281279
}
282280

283281
if (env.config.validateNoSetStateInEffects) {

0 commit comments

Comments
 (0)