The library for web and native user interfaces.
Mirrored from https://github.com/247TaxiDriver/QOS-React.git
Synced Nov 10, 20:15 UTC
[compiler] Allow different dependencies from explicit memoization when dependency is a ref
Summary: In theory, as I understand it, the result of a useRef will never change between renders, because we'll always provide the same ref value consistently. That means that memoization that depends on a ref value will never re-compute, so I think we could not infer it as a dependency in Forget. This diff, however, doesn't do that: it instead allows the validatePreserveExistingMemoizationGuarantees analysis to admit mismatches between explicit dependencies and implicit ones when the implicit dependency is a ref that doesn't exist in source. ghstack-source-id: 685d859d1eed5d1e19dbbbfadc75be3875ddb6ea Pull Request resolved: https://github.com/facebook/react/pull/30679