Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
compiler: fix accidental propagation of function effects from StartMe…
…moize/FinishMemoize By default, React Compiler will skip compilation if it cannot preserve existing memoization. Ie, if the code has an existing `useMemo()` or `useCallback()` and the compiler cannot determine that it is safe to keep that memoization — or do even better — then we'll leave the code alone. The actual compilation doesn't use any hints from existing memo calls, this is purely to check and avoid regressing any specific memoization that developers may have already applied. However, we were accidentally reporting some false-positive _validation_ errors due to the StartMemoize and FinishMemoize instructions that we emit to track where the memoization was in the source code. This is now fixed. Fixes #29131 Fixes #29132 ghstack-source-id: 9f6b8dbc5074ccc96e6073cf11c4920b5375faf6 Pull Request resolved: #29154
- Loading branch information