SIGN IN SIGN UP
facebook / react UNCLAIMED

The library for web and native user interfaces.

0 0 0 JavaScript

[compiler][wip] Extend ValidateNoDerivedComputationsInEffects for props derived effects

This PR adds infra to disambiguate between two types of derived state in effects:
  1. State derived from props
  2. State derived from other state

TODO:
- [ ] Props tracking through destructuring and property access does not seem to be propagated correctly inside of Functions' instructions (or i might be misunderstanding how we track aliasing effects)
- [ ] compiler/packages/babel-plugin-react-compiler/src/__tests__/fixtures/compiler/useEffect/invalid-derived-state-from-props-computed.js should be failing
- [ ] Handle "mixed" case where deps flow from at least one prop AND state. Should probably have a different error reason, to aid with categorization
L
Lauren Tan committed
190adb1ce177fbad88d63d49ac62221ef70f2f85
Parent: 44f6c7c
Committed by Jorge Cabiedes Acosta <jorgecab@meta.com> on 9/4/2025, 6:17:20 PM