mirror of
https://github.com/facebook/react.git
synced 2026-11-18 20:15:56 +00:00
Assignment expressions to a member path are a special case because they're the only place where a value isn't assigned to a (possibly temporary) variable, which is our unit of memoization. #901 demonstrated how this can lead to values that can't be independently memoized: ```javascript const x = {a: a} x.y = [b, c]; // array recomputed w `x`, even if only `a` changed ``` This PR ensures that assignment expressions where the LHS is a member path lower the RHS to a Place. That means the above example is handled as if you wrote: ```javascript const x = {a: a}; const tmp1 = [b, c]; x.y = tmp1; ``` And we independently memoize the temporary.