[Compiler Bug]: math operators prevent caching #32364
Labels
Component: Optimizing Compiler
Status: Unconfirmed
A potential issue that we haven't yet confirmed as a bug
Type: Bug
What kind of issue is this?
Link to repro
https://playground.react.dev/#N4Igzg9grgTgxgUxALhAMygOzgFwJYSYAEAYjHgpgCYAyeYOAFMEWuZVWEQL4CURwADrEiAGwQ4iADyIBeIgikAHSmDwA3BIzYVqYXgG5hRaQGpTRkTAmxijYyaIAeKhoB8DxwKndPzgPSu6h4ihsLcINxAA
Repro steps
It's not memoized, and
expensive
is called on every render.https://playground.react.dev/#N4Igzg9grgTgxgUxALhAMygOzgFwJYSYAEAYjHgpgCYAyeYOAFMEWuZVWADREQ4AWCGEQC+ASiLAAOsSIAbBDiIAPIgF4iCZQAdKYPADcEjNhWpgxAbhlEieNEUZ9BMCdNm3lAai-XZImyIYRVhiRkDbAB4qQwA+CNtJZQCPIkiAehiDeNkrGREQESA
Similar. Not cached.
https://playground.react.dev/#N4Igzg9grgTgxgUxALhAMygOzgFwJYSYAEAYjHgpgCYAyeYOAFMEWuZVWADREQ4AWCGEQC+ASiLAAOsSIAbBDiIAPIgF4iCZQAdKYPADcEjNhWpgxAbhlEieNEUZ9BMCdNm3VGgIw3RfmEVYYkY-WwAeKkMAPjDbSWUROPCAeiiDWNkrGREQESA
Cached properly.
How often does this bug happen?
Every time
What version of React are you using?
latest from playground
What version of React Compiler are you using?
latest from playground
The text was updated successfully, but these errors were encountered: